Skip to content

Commit

Permalink
debug by reducing complexity and adding formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreytitus committed Mar 25, 2024
1 parent e83207b commit d61352d
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/notify-slack-on-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,9 @@ jobs:
- name: Notify Slack on Issue or Comment
run: |
if [ "${{ github.event_name }}" == "issues" ]; then
PAYLOAD=$(cat <<EOF
{
"channel": "$SLACK_CHANNEL",
"text": "${{ github.event.issue.html_url }}"
}
EOF
)
PAYLOAD='{"channel":"'"$SLACK_CHANNEL"'","text":"'"${{ github.event.issue.html_url }}"'"}'
elif [ "${{ github.event_name }}" == "issue_comment" ]; then
PAYLOAD=$(cat <<EOF
{
"channel": "$SLACK_CHANNEL",
"text": "${{ github.event.issue.html_url }}"
}
EOF
)
PAYLOAD='{"channel":"'"$SLACK_CHANNEL"'","text":"'"${{ github.event.issue.html_url }}"'"}'
fi
curl -X POST -H 'Authorization: Bearer $SLACK_BOT_TOKEN' -H 'Content-type: application/json; charset=utf-8' --data "$PAYLOAD" https://slack.com/api/chat.postMessage
curl -X POST -H 'Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}' -H 'Content-type: application/json; charset=utf-8' --data "$PAYLOAD" https://slack.com/api/chat.postMessage

0 comments on commit d61352d

Please sign in to comment.