chore: fix reopening pr

This commit is contained in:
TonyRL 2026-07-22 22:30:24 +08:00
parent 1d8bac78ea
commit 8a9a64ad16
2 changed files with 11 additions and 0 deletions

View File

@ -81,6 +81,7 @@ jobs:
timeout-minutes: 5
steps:
- name: Check if PR author is denounced
id: vouch
uses: mitchellh/vouch/action/check-pr@d66fa29a64600490892131ad87597c30c91fcac4 # v1.5.0
with:
pr-number: ${{ github.event.pull_request.number }}
@ -88,6 +89,12 @@ jobs:
require-vouch: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Label denounced PR as spam
if: ${{ steps.vouch.outputs.status == 'closed' }}
run: gh pr edit ${{ github.event.pull_request.number }} --add-label spam
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
agentscan:
name: AgentScan

View File

@ -102,6 +102,10 @@ export default async function identify({ github, context, core }, body, number,
};
if (isPR) {
if (issue.labels.some((e) => e.name === 'spam')) {
core.info('PR labeled as spam, skipping');
return;
}
if (issue.state === 'closed') {
await updatePrState('open');
}