Skip to content

Commit

Permalink
fixup! build: notify via slack when review-wanted
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS committed Sep 24, 2024
1 parent fc44c62 commit 2334e32
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/notify-on-review-wanted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,30 @@ permissions:
jobs:
notifyOnReviewWanted:
name: Notify on Review Wanted
if: github.repository == 'nodejs/node'
if: github.repository == 'nodejs/node' && github.event.label == 'review wanted'
runs-on: ubuntu-latest
steps:
- name: Determine PR or Issue
id: check_pr_or_issue
id: define-message
run: |
if [[ -n "${{ github.event.pull_request.number }}" ]]; then
echo "::set-output name=type::pull_request"
echo "::set-output name=number::${{ github.event.pull_request.number }}"
number="${{ github.event.pull_request.number }}"
link="https://github.com/${{ github.repository }}/pull/$number"
echo "message=The PR (#$number) requires review from Node.js maintainers. See: $link" >> "$GITHUB_OUTPUT"
echo "title=${{ github.actor }} asks for attention on pull request #$number" >> "$GITHUB_OUTPUT"
else
echo "::set-output name=type::issue"
echo "::set-output name=number::${{ github.event.issue.number }}"
number="${{ github.event.issue.number }}"
link="https://github.com/${{ github.repository }}/issues/$number"
echo "message=The issue (#$number) requires review from Node.js maintainers. See: $link" >> "$GITHUB_OUTPUT"
echo "title=${{ github.actor }} asks for attention on issue #$number" >> "$GITHUB_OUTPUT"
fi
- name: Slack Notification
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907 # 2.3.0
env:
SLACK_COLOR: '#DE512A'
SLACK_ICON: https://github.com/nodejs.png?size=48
SLACK_TITLE: ${{ github.actor }} asks for review on ${{ steps.check_pr_or_issue.outputs.type == 'pull_request' && 'PR' || 'Issue' }} #${{ steps.check_pr_or_issue.outputs.number }}
SLACK_MESSAGE: |
This ${{ steps.check_pr_or_issue.outputs.type == 'pull_request' && 'PR' || 'Issue' }} requires review from Node.js maintainers <https://github.com/${{ github.repository }}/pull/${{ steps.check_pr_or_issue.outputs.number }}|#${{ steps.check_pr_or_issue.outputs.number }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>
SLACK_TITLE: ${{ steps.define-message.outputs.title }}

Check failure on line 37 in .github/workflows/notify-on-review-wanted.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

37:24 [colons] too many spaces after colon
SLACK_MESSAGE: ${{ steps.define-message.outputs.message }}
SLACK_USERNAME: nodejs-bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

0 comments on commit 2334e32

Please sign in to comment.