4ea41e164e
CI / test (push) Successful in 14s
CI / review (/anthropic/v1, anthropic--claude-4.6-sonnet, sonnet, anthropic, SONNET_REVIEW_TOKEN) (push) Has been skipped
CI / review (/openai/v1, gpt-5, gpt, openai, GPT_REVIEW_TOKEN) (push) Has been skipped
CI / review (/openai/v1, gpt-5, security, openai, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (push) Has been skipped
Also clear the ready label (ID 38) on push, matching gargoyle behavior.
41 lines
1.6 KiB
YAML
41 lines
1.6 KiB
YAML
name: PR Ready Gate
|
|
|
|
on:
|
|
pull_request:
|
|
types: [synchronize]
|
|
|
|
jobs:
|
|
clear-labels:
|
|
runs-on: ubuntu-24.04
|
|
if: |
|
|
contains(github.event.pull_request.labels.*.name, 'ready') ||
|
|
contains(github.event.pull_request.labels.*.name, 'self-reviewed')
|
|
steps:
|
|
- name: Remove ready and self-reviewed labels, reassign to author
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.RODIN_TOKEN }}
|
|
run: |
|
|
PR_NUMBER=${{ github.event.pull_request.number }}
|
|
AUTHOR=${{ github.event.pull_request.user.login }}
|
|
READY_LABEL_ID=38
|
|
SELF_REVIEWED_LABEL_ID=37
|
|
|
|
# Remove ready label if present
|
|
curl -sS -X DELETE \
|
|
-H "Authorization: token $GITEA_TOKEN" \
|
|
"https://gitea.weiker.me/api/v1/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/${READY_LABEL_ID}" || true
|
|
|
|
# Remove self-reviewed label if present
|
|
curl -sS -X DELETE \
|
|
-H "Authorization: token $GITEA_TOKEN" \
|
|
"https://gitea.weiker.me/api/v1/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/${SELF_REVIEWED_LABEL_ID}" || true
|
|
|
|
# Reassign to author
|
|
curl -sS -X PATCH \
|
|
-H "Authorization: token $GITEA_TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"assignees\": [\"${AUTHOR}\"]}" \
|
|
"https://gitea.weiker.me/api/v1/repos/${{ github.repository }}/pulls/${PR_NUMBER}"
|
|
|
|
echo "Cleared ready/self-reviewed labels and reassigned PR #${PR_NUMBER} to ${AUTHOR}"
|