Skip to content

Commit

Permalink
Switch to official Slack API
Browse files Browse the repository at this point in the history
The existing service does not seem to stable and does not work so
switch to using the official Spack API GitHub action instead.
  • Loading branch information
mkindahl committed Apr 3, 2024
1 parent a9a0334 commit 034d577
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/issue-handling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,24 @@ jobs:
contains(github.event.issue.labels.*.name, 'security') )
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL_SECURITY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:

- name: Generate message
run: |
gh api ${{ github.event.issue.url }} --template="{\"channel\": \"$SLACK_CHANNEL\", \"text\": \"Issue <{{.url}}|#{{.number}} {{.title}}> needs attention\"}" | tee message.json
- name: Send slack message
uses: krider2010/slack-bot-action@1.0.1
env:
MESSAGE_FILE: message.json
- name: Post to Security Channel
uses: slackapi/slack-github-action@v1.25.0
with:
channel-id: '${{ secrets.SLACK_CHANNEL_SECURITY }}'
payload: |
{
"text": "Issue #${{github.event.issue.number}} (${{github.event.issue.title}})> needs attention",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Issue <${{github.event.issue.url}}|#${{github.event.issue.number}} ${{github.event.issue.title}}> needs attention"
}
}
]
}
close-issue:
name: Issue is closed
Expand Down

0 comments on commit 034d577

Please sign in to comment.