Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benmatselby/gollum-page-watcher-action
📦 A GitHub Action to watch for GitHub Wiki Page changes, and then notify a Slack channel
https://github.com/benmatselby/gollum-page-watcher-action
github-action github-action-slack github-action-wiki
Last synced: 6 days ago
JSON representation
📦 A GitHub Action to watch for GitHub Wiki Page changes, and then notify a Slack channel
- Host: GitHub
- URL: https://github.com/benmatselby/gollum-page-watcher-action
- Owner: benmatselby
- License: mit
- Created: 2020-03-05T21:52:06.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-07T05:49:02.000Z (about 1 month ago)
- Last Synced: 2024-10-10T09:26:39.908Z (29 days ago)
- Topics: github-action, github-action-slack, github-action-wiki
- Language: Go
- Homepage:
- Size: 284 KB
- Stars: 15
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Watch for GitHub Wiki page changes and post to Slack
- fucking-awesome-actions - Watch for GitHub Wiki page changes and post to Slack
- awesome-workflows - Watch for GitHub Wiki page changes and post to Slack
README
# Gollum Page Watcher GitHub Action
[![Go Report Card](https://goreportcard.com/badge/github.com/benmatselby/gollum-page-watcher-action)](https://goreportcard.com/report/github.com/benmatselby/gollum-page-watcher-action)
A GitHub Action to watch for GitHub Wiki Page changes, and then notify a Slack channel
## Secrets
- `SLACK_WEBHOOK`: The Slack Webhook URL required to post a message to your workspace.
## Environment Variables
- `SLACK_USERNAME`: The Slack username if you want to define it, otherwise it will be what you have defined in Slack.
- `SLACK_CHANNEL`: The Slack channel if you want to define it, otherwise it will be what you have defined in Slack.
- `PAGES_TO_WATCH`: A regex of page titles you want to watch, in order to get a notification. If not defined, all pages are watched.## Example
```shell
...
- name: Wiki Watcher
uses: benmatselby/gollum-page-watcher-action@v1
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: #random
SLACK_USERNAME: Gollum
PAGES_TO_WATCH: (^Home$)|(^Meeting minutes)
...
```This will result in a match on "Home", and all pages with a title starting with "Meeting minutes".
![Output](./img/output.png)
## Testing
To test this, you can run it from your command line with the following setup
```shell
GITHUB_EVENT_PATH=example-payloads/valid-payload.json \
GITHUB_EVENT_NAME=gollum \
SLACK_WEBHOOK=[your-slack-webhook-url] \
SLACK_CHANNEL=[your-slack-channel] \
DEBUG=true \
go run main.go
```If `DEBUG` is defined, it will not post to Slack, but rather output the webhook message in your terminal.
![Gollum](./img/gollum.jpg)