Skip to content

This is a test issue! #7

This is a test issue!

This is a test issue! #7

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 new issue has been opened by _${{ github.event.issue.user.login }}_ in *${{ github.repository }}*
> <${{ github.event.issue.html_url }}|*#${{ github.event.issue.number }} ${{ github.event.issue.title }}*>
"@
$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