GitHub Action
Keybase Build Notifications
This action allows you to post GitHub build notifications to Keybase Chat channels, teams, and DMs. It sends messages via the opensentinel API, using your owner
and token
values.
- Using the Action
- Parameters
- What about other GitHub events?
- Filtering Notifications
- Versioning
- How to get help
- License
NOTE: The
marvinpinto/action-keybase-notifications
repository is an automatically generated mirror of the marvinpinto/actions monorepo containing this and other actions. Please file issues and pull requests over there.
You will need an opensentinel API token in order to use this action. Go through the @sentinelbot setup flow for a Generic Webhook and make a note of the owner
and token
values in the URL you receive.
As a reference, @sentinelbot
Webhook URLs for Keybase will look something like:
https://api.opensentinel.com/kb/webhooks?owner=<OSL_OWNER>&token=<OSL_TOKEN>
name: "CI Tests"
on:
push:
jobs:
ci:
runs-on: "ubuntu-latest"
steps:
# ...
- name: "Build & test"
run: |
echo "done!"
# Add the notification step as the last one
- uses: "marvinpinto/action-keybase-notifications@latest"
if: always()
with:
job_status: ${{ job.status }}
opensentinel_owner: ${{ secrets.OSL_OWNER }}
opensentinel_token: ${{ secrets.OSL_TOKEN }}
on_success: "never"
on_failure: "always"
This will send you a Keybase chat notification whenever a CI build fails but not when it passes (if you wanted to reduce channel noise). The if: always()
stanza above ensures that the notification step runs no matter what.
on:
push:
tags:
- "v*"
jobs:
ci:
runs-on: "ubuntu-latest"
steps:
# ...
- name: "Build & test"
run: |
echo "done!"
- name: "Deploy to production"
run: |
echo "+1"
- uses: "marvinpinto/action-keybase-notifications@latest"
if: always()
with:
job_status: ${{ job.status }}
job_name: "Production Release"
opensentinel_owner: ${{ secrets.OSL_OWNER }}
opensentinel_token: ${{ secrets.OSL_TOKEN }}
This will send you a notification message to let you know if the production release was successful or not.
Parameter | Description | Default |
---|---|---|
opensentinel_owner ** |
URL querystring value for owner | null |
opensentinel_token ** |
URL querystring value for token | null |
job_status ** |
GitHub Actions job status - use ${{ job.status }} |
null |
job_name |
Display name to use in the chat message | Workflow name |
on_success |
When a build passes, notify you "always" or "never"? | always |
on_failure |
When a build fails, notify you "always" or "never"? | always |
- Parameters denoted with
**
are required.
Due to the way the permission system around GitHub Actions works, repo secrets cannot be accessed by users on forks & such. In general, an Action that requires a secret will fail when invoked through a pull request from a fork.
This action will do its hardest to NOT fail the build as a result of a processing error (network/permissions/etc).
If you're still interested in receiving Keybase notifications for other GitHub events (push
, pull_request
, etc), set up a GitHub Notification webhook with opensentinel and add that to your repository. The webhook system is not bound by the permission issues mentioned here!
You can cut down on chat noise by applying filters to events that trigger this action. For example, you can send a Keybase build notification only when someone pushes to the master
branch.
on:
push:
branches:
- master
Read through the GitHub documentation for advanced examples.
Every commit that lands on master for this project triggers an automatic build as well as a tagged release called latest
. If you don't wish to live on the bleeding edge you may use a stable release instead. See releases for the available versions.
- uses: "marvinpinto/action-keybase-notifications@<VERSION>"
The main README for this project has a bunch of information related to debugging & submitting issues. Opensentinel help is available in the opensentinel.users user group. If you're still stuck, try and get a hold of me on keybase and I will do my best to help you out.
The source code for this project is released under the MIT License. This project is not associated with Keybase or GitHub.