build(deps): bump slackapi/slack-github-action from 1.27.0 to 2.0.0 #138
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: Handle Label Notifications | |
permissions: {} | |
on: | |
issues: | |
types: | |
- labeled | |
pull_request_target: | |
types: | |
- labeled | |
jobs: | |
process: | |
name: Process Label | |
if: github.event.label.name == 'regression' || github.event.label.name == 'crash' | |
runs-on: ubuntu-latest | |
env: | |
ISSUE_URL: ${{ github.event.issue.html_url || github.event.pull_request.html_url }} | |
steps: | |
- name: Send Slack Notification | |
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 | |
env: | |
ISSUE_TITLE: ${{ toJSON(github.event.issue.title || github.event.pull_request.title) }} | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
with: | |
channel-id: ${{ secrets.SLACK_CHANNEL }} | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ":warning: [AWSCC] The following has been labeled as a ${{ github.event.label.name }}:" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ${{ toJSON(format('<{0}|{1}>', env.ISSUE_URL, env.ISSUE_TITLE)) }} | |
} | |
} | |
] | |
} | |
- name: Generate GitHub App Token | |
id: token | |
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PEM }} | |
- name: Move to the Top of the Team Working Board | |
env: | |
GH_TOKEN: ${{ steps.token.outputs.token }} | |
run: | | |
PROJECT_ITEM_ID=$(gh project item-add 196 --owner "hashicorp" --url "$ISSUE_URL" --format json --jq '.id') | |
gh project item-edit \ | |
--id "$PROJECT_ITEM_ID" \ | |
--project-id "PVT_kwDOAAuecM4AF-7h" \ | |
--field-id "PVTSSF_lADOAAuecM4AF-7hzgMRB34" \ | |
--single-select-option-id "${{ vars.team_project_view_working_board }}" | |
gh api graphql \ | |
-F itemId="$PROJECT_ITEM_ID" \ | |
-F projectId="PVT_kwDOAAuecM4AF-7h" \ | |
-f query='mutation($itemId:ID!, $projectId:ID!) { | |
updateProjectV2ItemPosition(input:{itemId:$itemId, projectId:$projectId}) { | |
clientMutationId | |
} | |
}' |