Skip to content

New rules to make small changes easier #16

New rules to make small changes easier

New rules to make small changes easier #16

name: Bypass Version File Review by Admin
on:
pull_request:
types: [opened, synchronize]
jobs:
bypass-version-review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up GitHub CLI Authentication
env:
GH_TOKEN: ${{ secrets.ADMIN_PAT }}
run: |
AUTHOR=$(gh pr view ${{ github.event.pull_request.number }} --json author --jq '.author.login')
ADMIN_CHECK=$(gh api user/memberships/orgs/scidsg --jq '.role')
if [ "$ADMIN_CHECK" != "admin" ]; then
echo "User is not an admin or is not a public member of the organization. Exiting."
exit 1
fi
- name: Check for hushline/version.py and approve if conditions are met
run: |
if git diff --name-only main ${{ github.head_ref }} | grep -q '^hushline/version.py$'; then
echo "hushline/version.py detected and user is an admin, approving PR"
gh pr review ${{ github.event.pull_request.number }} --approve --body "Approved: hushline/version.py changes detected and user is an admin."
else
echo "No matching files detected or user is not an admin, continuing with normal review process"
fi
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_PAT }}