Skip to content

Commit

Permalink
Fix reject-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-claudia authored Sep 24, 2024
1 parent 50e45b1 commit e16cc31
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/reject-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: |
set -euo pipefail
echo "event name: $GITHUB_EVENT_NAME"
if [[ "$GITHUB_EVENT_NAME" != "pull_request_target" ]]; then
echo "::error::This action must only be run on 'pull_request_target' events"
exit 1
esac
export GITHUB_TOKEN="$GH_TOKEN_SECRET"
gh pr close "$PR_URL" --comment "$MESSAGE" --reason 'not planned' &&
gh pr lock "$PR_URL" --reason 'resolved'
env:
GITHUB_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.issue.url }}
PR_URL: ${{ github.event.pull_request.url }}
MESSAGE: Hey @${{ github.actor }}, this pull request should be directed towards `${{ inputs.correct_branch }}`. Please file a new pull request targeting that branch instead.

0 comments on commit e16cc31

Please sign in to comment.