Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ai-gatekeeper-rerun.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Bot Gatekeeper Rerun
on:
pull_request_review:
types: [submitted]

permissions:
actions: write
pull-requests: read

jobs:
rerun:
if: ${{ github.event.review.state == 'approved' }}
runs-on: ubuntu-latest
steps:
- name: Re-run gatekeeper on review change
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
REF: ${{ github.event.pull_request.head.sha }}
run: |
gh workflow run ai-gatekeeper.yaml --ref "$REF" -f pr="$PR"
25 changes: 24 additions & 1 deletion .github/workflows/ai-gatekeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request_review:
types: [submitted, edited, dismissed]
workflow_dispatch:
inputs:
pr:
description: "PR number"
required: true
type: string

permissions:
contents: read
Expand All @@ -22,11 +27,29 @@ jobs:
run:
shell: bash
steps:
- name: Skip docs-only changes
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number || github.event.inputs.pr }}
REPO: ${{ github.repository }}
run: |
FILES=$(gh pr view "$PR" --repo "$REPO" --json files --jq '.files[].path')
if [ -z "$FILES" ]; then
echo "No files found; continuing."
exit 0
fi

NON_DOCS=$(echo "$FILES" | grep -Ev '^(docs/|README|.*\.md$)' || true)
if [ -z "$NON_DOCS" ]; then
echo "✅ Docs-only changes. Skipping gatekeeper."
exit 0
fi

- name: Analyze Authorship and Approvals
id: check
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
PR: ${{ github.event.pull_request.number || github.event.inputs.pr }}
REPO: ${{ github.repository }}
run: |
# 1. Fetch PR Data
Expand Down
Loading