fix: do not repeat error code in query call reject message #5988
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: PR Slack Notification | |
on: | |
pull_request: | |
types: [review_requested] | |
jobs: | |
notify-slack: | |
name: Notify Slack | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get requested team reviewers | |
id: get-reviewers | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
return "requested_team" in context.payload ? context.payload.requested_team.name : "" | |
- name: Lookup Slack channel | |
id: lookup | |
if: steps.get-reviewers.outputs.result != '""' | |
run: | | |
TEAM=${{ steps.get-reviewers.outputs.result }} | |
CHANNEL=$(jq -r --arg team "$TEAM" '.[$team]' .github/workflows/team-channels.json) | |
echo "channel=${CHANNEL}" >> $GITHUB_OUTPUT | |
echo "message=${MESSAGE}" >> $GITHUB_OUTPUT | |
env: | |
MESSAGE: ":github: <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>" | |
- name: Post to a Slack channel | |
if: steps.get-reviewers.outputs.result != '""' && steps.lookup.outputs.channel != 'null' | |
id: slack | |
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 | |
with: | |
channel-id: ${{ steps.lookup.outputs.channel }} | |
slack-message: "${{ steps.lookup.outputs.message }}" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_API_TOKEN }} |