| Input Name | Description | Required | Default |
|---|---|---|---|
strict |
If the action should fail in the absence of discord-webhook [1] |
true |
|
github-token |
GitHub Token [2] | ✅ | |
discord-webhook |
Discord Webhook URL | "" (an empty string) |
|
username |
Overrides the current username of the webhook | GitHub Actions | |
avatar-url |
Overrides the current avatar of the webhook | Avatar |
[1] strict was added to ease forking repositories depending on this action
as the webhook should be a secret (which, unless you add it, will not be available in forks).
If strict is false, the action will not fail in the absence of discord-webhook and instead return a "success" status.
Once GitHub adds full support for core.setNeutral,
instead of resulting in "success" (which fails to properly describe the action result),
this action should result in "neutral" (or whatever name they decide for it).
[2] The GitHub token is required because this action reads the current workflow's jobs.
See octokit.actions.listJobsForWorkflowRun for more information.
name: Build and Test
on: [pull_request]
jobs:
build:
name: Build the Code
steps:
- run: make all
notify:
name: Notify Discord
runs-on: ubuntu-latest
if: ${{ always() }} # You always want to be notified: success, failure, or cancelled
needs:
- build
steps:
- name: Notify
uses: jmg-duarte/workflow-notify-discord@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}