GitHub Action to notify repositories about the repository's releases using a GitHub App
Important: if the release event was created by another GitHub action authenticated with secrets.GITHUB_TOKEN
, no workflow is triggered for that release event. To workaround that problem, use a personal access token instead of secrets.GITHUB_TOKEN
to create the release
event. See Triggering new workflows using a personal access token.
In order to use the action, you have to register a GitHub app.
GitHub App name
: set to something like<Your Project> Release Notifier
Description
: copy/paste most of this repository's Notifier app. Make sure to replacerelease-notifier-release
with<your-project>-release
Homepage URL
: your repository URLWebhook
: remove the check from[ ] Active
Repository permissions
: Enable Read & Write access forContents
Where can this GitHub App be installed?
: Any account (unless you only want installs for repositories with in your account/organization)
Once you are done, generate & download a private key. In your repository, create to secrets:
APP_ID
: set to your newly registeredApp ID
APP_PRIVATE_KEY
: set to the contents of the downloaded*.pem
file
Notify repositories only when a release was published. The repository dispatch event type is set to [current repositories full name] release
(e.g. gr2m/release-notifier-action release
)
name: Release Notification
on:
release:
types:
- published
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: gr2m/release-notifier-action@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
If you want to notify repositories for all release activity types, you can do
name: Release Notification
on: release
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: gr2m/release-notifier-action@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
To customize the repository dispatch event type use the dispatch_event_type
argument
name: Release Notification
on:
release:
types:
- published
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: gr2m/release-notifier-action@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
dispatch_event_type: my-project-release
Each time you create, edit, or delete a release on your repository, the action will load all installations using the credentials you provided. For each installation, the action dispatch creates a repository dispatch event and sets the event type to what you configured in inputs.dispatchEventType
.