Skip to content

Commit

Permalink
tools: fix notify-on-push Slack messages
Browse files Browse the repository at this point in the history
PR-URL: #47453
Refs: https://api.slack.com/reference/surfaces/formatting#special-mentions
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
aduh95 authored and RafaelGSS committed Apr 13, 2023
1 parent b1f2ff1 commit 4fbfa3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/notify-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
SLACK_ICON: https://github.com/nodejs.png?size=48
SLACK_TITLE: ${{ github.actor }} force-pushed to ${{ github.ref }}
SLACK_MESSAGE: |
@here A commit was force-pushed to <https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.repository }}@${{ github.ref_name }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>
<!here> A commit was force-pushed to <https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.repository }}@${{ github.ref_name }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>
Before: <https://github.com/${{ github.repository }}/commit/${{ github.event.before }}|${{ github.event.before }}>
After: <https://github.com/${{ github.repository }}/commit/${{ github.event.after }}|${{ github.event.after }}>
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
if: ${{ env.PR_ID }}
run: |
gh pr comment ${{ env.PR_ID }} --repo "${{ github.repository }}" \
--body "A commit referencing this Pull Request was pushed to `main` by @${{ github.actor }} without the expected commit metadata added to its message."
--body "A commit referencing this Pull Request was pushed to `${{ github.ref_name }}` by @${{ github.actor }} with an invalid commit message."
env:
GH_TOKEN: ${{ github.token }}
- name: Slack Notification
Expand All @@ -62,7 +62,7 @@ jobs:
SLACK_ICON: https://github.com/nodejs.png?size=48
SLACK_TITLE: Invalid commit was pushed to ${{ github.repository.default_branch }}
SLACK_MESSAGE: |
@here A commit lacking the expected metadata was pushed to <https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.repository }}@${{ github.ref_name }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>.
<!here> A commit with an invalid message was pushed to <https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.repository }}@${{ github.ref_name }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>.
Before: <https://github.com/${{ github.repository }}/commit/${{ github.event.before }}|${{ github.event.before }}>
After: <https://github.com/${{ github.repository }}/commit/${{ github.event.after }}|${{ github.event.after }}>
Expand Down

0 comments on commit 4fbfa3c

Please sign in to comment.