Test Issue Title #3
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: Issue Activity | |
on: | |
issues: | |
types: [opened] | |
env: | |
SLACK_NOTIFICATION_CHANNEL: ${{ secrets.SLACK_APP_NOTIFICATION_CHANNEL }} | |
jobs: | |
slack: | |
name: Slack Notifications | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send issue to Slack | |
shell: pwsh | |
run: | | |
$messageBody = @' | |
A <${{ github.event.issue.html_url }}|new issue> has been opened by _${{ github.event.issue.user.login }}_ in *${{ github.repository }}* | |
> Title: ${{ github.event.issue.title }} `#${{ github.event.issue.number }}` | |
> Body: ${{ github.event.issue.body }} | |
'@ | |
$headers = @{ | |
"Authorization" = "Bearer ${{ secrets.SLACK_APP_TOKEN }}" | |
} | |
$body = @{ | |
"text" = $messageBody | |
"channel" = $env:SLACK_NOTIFICATION_CHANNEL | |
"mrkdwn" = $true | |
"parse" = "none" | |
} | |
# Post the message | |
Invoke-WebRequest -Uri "https://slack.com/api/chat.postMessage" -Method POST -Headers $headers -Body $body |