mirror of
https://github.com/block/goose.git
synced 2026-06-02 06:19:33 +02:00
2bc2b6cd75
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: Quarantine check
|
|
|
|
on:
|
|
pull_request_target:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
issues: write
|
|
|
|
jobs:
|
|
check-quarantined:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Check PR Author
|
|
run: |
|
|
# Get PR author
|
|
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
|
|
|
|
# Convert comma-separated list to array
|
|
IFS=',' read -ra QUARANTINE_LIST <<< "${{ vars.QUARANTINED_USERS }}"
|
|
|
|
# Check if PR author is in the quarantine list
|
|
for user in "${QUARANTINE_LIST[@]}"; do
|
|
if [ "$user" = "$PR_AUTHOR" ]; then
|
|
echo "PR author is in the quarantine list - closing PR"
|
|
# Close PR using GitHub CLI
|
|
gh pr close ${{ github.event.pull_request.number }} -c "Thanks for this, please contact the project on discord before opening PRs"
|
|
exit 0
|
|
fi
|
|
done
|
|
|
|
echo "continuing..."
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|