Skip to content

Commit

Permalink
Abandon official Slack action since it doesn't like attachments or bl…
Browse files Browse the repository at this point in the history
…ocks
  • Loading branch information
jdangerx committed Nov 30, 2023
1 parent b999396 commit 764bdcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
23 changes: 3 additions & 20 deletions .github/workflows/run-archiver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,10 @@ jobs:
./scripts/make_slack_notification_message.py --summary-files *_run_summary.json | tee slack-payload.json
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: test Slack Action
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"text": "Text: GitHub Action build result: ${{ job.status }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Block: GitHub Action build result: ${{ job.status }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
- name: Inform the Codemonkeys
uses: slackapi/slack-github-action@v1.24.0
uses: 8398a7/action-slack@v3
with:
payload: ${{ steps.all_summaries.outputs.SLACK_PAYLOAD }}
status: custom
custom_payload: ${{ steps.all_summaries.outputs.SLACK_PAYLOAD }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
7 changes: 5 additions & 2 deletions scripts/make_slack_notification_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ def header_block(text):
print(
json.dumps(
{
"text": "Archiver run completed!",
"blocks": changed_blocks + unchanged_blocks,
"attachments": [
{
"blocks": changed_blocks + unchanged_blocks,
}
]
},
indent=2,
)
Expand Down

0 comments on commit 764bdcb

Please sign in to comment.