Skip to content

Commit

Permalink
fix : secret json형식으로 변환
Browse files Browse the repository at this point in the history
  • Loading branch information
kssumin authored Aug 22, 2024
1 parent 88c8649 commit 9d484a5
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/pr-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ name: PR Slack Notification
on:
pull_request:
types: [opened, reopened]

permissions:
pull-requests: read

jobs:
notify_reviewers:
runs-on: ubuntu-latest
Expand All @@ -20,12 +18,11 @@ jobs:
echo "Error: SLACK_IDS is not set"
exit 1
fi
- name: Set environment variables
run: |
echo "SLACK_WEBHOOK_URL=${{ secrets.SLACK_PR_CREATE_WEBHOOK_URL }}" >> $GITHUB_ENV
echo "SLACK_IDS=${{ secrets.SLACK_IDS }}" >> $GITHUB_ENV
echo 'SLACK_IDS=${{ toJson(secrets.SLACK_IDS) }}' >> $GITHUB_ENV
shell: bash
- name: Send Slack notification for new PR
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
Expand All @@ -40,10 +37,6 @@ jobs:
echo "Reviewers: $REVIEWERS"
parse_slack_ids() {
if ! echo "$SLACK_IDS" | jq empty; then
echo "Error: Invalid JSON in SLACK_IDS" >&2
exit 1
fi
echo "$SLACK_IDS" | jq -r 'to_entries | map("\(.key):\(.value)") | .[]'
}
Expand Down

0 comments on commit 9d484a5

Please sign in to comment.