Skip to content

Test Issue Title

Test Issue Title #3

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