After making changes to index.mjs
, run
pnpm build
to compile the script and its dependencies into a single file and a sourcemap file. Make sure to commit both files.
To learn more, see Javascript actions.
- The action needs
actions: read
permission in order to calllistJobsForWorkflowRunAttempt
. - The action needs
pull-requests: read
permission in order to calllistPullRequestsAssociatedWithCommit
.
The action can either be run as a step in a deploy job or as a separate job running after the deploy job.
If running as a step in a deploy job, result
should be set to the value of job.status
from the
job context, which
contains the current status of the job (Possible values are success
, failure
, or cancelled
):
steps:
# ... (deploy steps) ...
- if: failure() || success()
uses: biblioteksentralen/github-actions/notify-teams-deployment@main
with:
title: Libry Content
webhooks-url: "${{ secrets.MS_TEAMS_WEBHOOK_URI_DEPLOY_CHANNEL }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
result: "${{ job.status }}"
Make sure that the job has at least the following permissions:
permissions:
contents: read
actions: read
pull-requests: read
If running as a separate job, result
should be set to the value of needs.<job_id>.result
from
the needs context,
where <job_id>
is the id of the deploy job (Possible values are success
, failure
, cancelled
or skipped
):
jobs:
deploy:
# ... (deploy steps) ...
notify:
# Run if previous job was successful or failed, but not if it was cancelled.
if: success() || failure()
name: Notify Teams
runs-on: ubuntu-22.04
permissions:
contents: read
actions: read
pull-requests: read
needs:
- deploy
steps:
- uses: biblioteksentralen/github-actions/notify-teams-deployment@main
with:
title: Testy test
webhooks-url: '${{ secrets.MS_TEAMS_WEBHOOK_URI}}'
github-token: '${{ secrets.GITHUB_TOKEN }}'
result: '${{ needs.deploy.result }}'
See action.yml for more details.