Skip to content

Commit

Permalink
chore: Restores notification when changelog update fails (#2176)
Browse files Browse the repository at this point in the history
* restore slack notification when automatic commit fails

* fix automatic commit to follow guidelines

* add chore prefix in release commits

* use link instead of button in notification

* remove extra comma
  • Loading branch information
oarbusi authored Apr 19, 2024
1 parent bae1cbf commit a8f2a98
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,35 @@ jobs:
with:
script_call: 'make tools update-changelog-unreleased-section'
file_to_commit: 'CHANGELOG.md'
commit_message: ${{ github.event_name == 'workflow_dispatch' && 'Update CHANGELOG.md (Manual Trigger)' || format('{0}{1}', 'Update CHANGELOG.md for \#', github.event.pull_request.number) }}
commit_message: ${{ github.event_name == 'workflow_dispatch' && format('{0}{1}', 'chore:',' Updates CHANGELOG.md (Manual Trigger)') || format('{0}{1}{2}{3}', 'chore:', ' Updates CHANGELOG.md for ', '#', github.event.pull_request.number) }}
secrets:
apix_bot_pat: ${{ secrets.APIX_BOT_PAT }}
remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }}
gpg_private_key: ${{ secrets.APIX_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }}


slack-notification:
needs: [generate-and-update-changelog]
if: ${{ !cancelled() && needs.generate-and-update-changelog.result == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: Send Slack message
id: slack
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
with:
payload: |
{
"text": "Automatic Changelog update failed",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Automatic Changelog update failed* ${{ secrets.SLACK_ONCALL_TAG }}. <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}|Failed action >"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
with:
script_call: './scripts/update-examples-reference-in-docs.sh ${{inputs.version_number}}'
file_to_commit: 'website/docs/index.html.markdown'
commit_message: 'Update examples link in index.html.markdown for ${{ github.event.inputs.version_number }} release'
commit_message: 'chore: Updates examples link in index.html.markdown for ${{ github.event.inputs.version_number }} release'
secrets:
apix_bot_pat: ${{ secrets.APIX_BOT_PAT }}
remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }}
Expand All @@ -68,7 +68,7 @@ jobs:
with:
script_call: './scripts/update-changelog-header-for-release.sh ${{inputs.version_number}}'
file_to_commit: 'CHANGELOG.md'
commit_message: 'Update CHANGELOG.md header for ${{ github.event.inputs.version_number }} release'
commit_message: 'chore: Updates CHANGELOG.md header for ${{ github.event.inputs.version_number }} release'
secrets:
apix_bot_pat: ${{ secrets.APIX_BOT_PAT }}
remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }}
Expand Down

0 comments on commit a8f2a98

Please sign in to comment.