Default (completed) #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Default (completed) | |
on: | |
workflow_run: | |
workflows: 'Default' | |
types: | |
- completed | |
jobs: | |
context: | |
runs-on: ubuntu-latest | |
outputs: | |
is_release_master: true | |
is_release_tag: true | |
steps: | |
- uses: actions/checkout@v4 | |
notify_slack: | |
runs-on: ubuntu-latest | |
needs: [context] | |
# Only notify slack on release events | |
if: ${{ needs.context.outputs.is_release_master || needs.context.outputs.is_release_tag }} | |
steps: | |
- name: Notify Slack | |
uses: mozilla/addons/.github/actions/slack@main | |
env: | |
is_release_master: ${{ needs.context.outputs.is_release_master }} | |
event: ${{ github.event_name }} | |
conclusion: ${{ github.event.workflow_run.conclusion }} | |
emoji: ${{ env.conclusion == 'success' && ':white_check_mark:' || ':x:' }} | |
workflow_id: ${{ github.event.workflow_run.id }} | |
workflow_url: ${{ github.event.workflow_run.url }} | |
text_template: '{0} {1} completed with {2}' | |
retry_template: '[Rerun Workflow]({0})' | |
workflow_template: ':github: *Workflow Run:* [{0}]({1})' | |
triggered_template: ':bust_in_silhouette: *Triggered by:* @{0}' | |
with: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
method: chat.postMessage | |
payload: | | |
channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }} | |
text: ${{ format(env.text_template, env.emoji, env.event, env.conclusion) }} | |
blocks: | |
- type: context | |
elements: | |
- type: mrkdwn | |
text: ${{ format(env.text_template, env.emoji, env.event, env.conclusion) }} | |
- type: mrkdwn | |
text: ${{ format(env.workflow_template, env.workflow_id, env.workflow_url) }} | |
- type: mrkdwn | |
text: ${{ format(env.triggered_template, github.actor) }} | |
# ${{ github.event.workflow_run.conclusion == 'failure' && format(' | |
# - type: section | |
# text: | |
# type: mrkdwn | |
# text: ${{ format(env.retry_template, github.event.workflow_run.rerun_url) }} | |
# ')}} | |