Skip to content

fix: Loosens IdentificationLink to string #19

fix: Loosens IdentificationLink to string

fix: Loosens IdentificationLink to string #19

name: Slack Notification
on:
pull_request:
types: [opened]
jobs:
slack-notify:
name: Slack Notification
runs-on: ubuntu-latest
env:
PULL_REQUEST_BODY: ${{ github.event.pull_request.body || 'The person did not write a PR description 😢' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false
- name: Convert PR body to Slack format
id: slackify
uses: LoveToKnow/[email protected]
with:
text: ${{ env.PULL_REQUEST_BODY }}
- name: Generate notification payload
id: notification
env:
TITLE: ${{ github.event.pull_request.title }}
USER_LOGIN: ${{ github.event.pull_request.user.login }}
HTML_URL: ${{ github.event.pull_request.html_url }}
run: |
payload=$(node ./.github/utils/slack-notify.mjs '${{ env.TITLE }}' '${{ env.USER_LOGIN }}' '${{ env.HTML_URL }}' '${{ steps.slackify.outputs.text }}')
echo "payload=${payload//$'\n'/'%0A'}" >> $GITHUB_OUTPUT
- name: Send PR to Slack
id: slack
uses: slackapi/[email protected]
with:
payload: ${{ steps.notification.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK