Skip to content

Commit

Permalink
feat: Adds local running documentation and script
Browse files Browse the repository at this point in the history
  • Loading branch information
AshCorr committed Mar 15, 2022
1 parent 33b0c7c commit f50bab9
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cargo",
"command": "run",
"problemMatcher": [
"$rustc"
],
"label": "Run google-chats-pr-announcer",
"env": {
"GITHUB_REPOSITORIES": "guardian/dotcom-rendering"
}
}
]
}
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,47 @@ This action automatically sends a message to google chats detailing the list of

## Example usage

```
```yaml
uses: guardian/google-chats-pr-announcer@v1
with:
google-webhook-url: 'https://chats.google.com...'
```
## Contributing
### Running Locally
```bash
# List of repositories to scan
export GITHUB_REPOSITORIES=guardian/dotcom-rendering,guardian/frontend
# Token used for accessing github API's, this should be your personal access token
export GITHUB_TOKEN=<secret!>
# Webhook URL to send chat messages to, can be generated in the Google Chats application.
export GOOGLE_WEBHOOK_URL=https://chats.google.com...
# List of users to ignore when scanning for PR's
export GITHUB_IGNORED_USERS=dependabot
# List of labels to ignore when scanning for PR's
export GITHUB_IGNORED_LABELS=dependencies

cargo run
```

### Running Locally in VSCode

A VSCode run task has been included for simplicity. You can run the project by following these steps

1. Press `Ctrl` + `Shift` + `P`
2. Search for `Preferences: Open Settings (JSON)`
3. Add your secret values to your vscode settings (replace linux with osx/windows as needed)

```json
{
"terminal.integrated.env.linux": {
"GITHUB_TOKEN": "Super secret!",
"GOOGLE_WEBHOOK_URL": "Also secret!"
}
}
```

4. Search for `Tasks: Run Task`
5. Select `Run google-chats-pr-announcer`

0 comments on commit f50bab9

Please sign in to comment.