Skip to content

Commit 41c3388

Browse files
Copilotfregante
andauthored
Meta: add rudimentary AI PR auto-close workflow (#9465)
Co-authored-by: fregante <me@fregante.com>
1 parent 7cd7f3c commit 41c3388

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/pr.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ on:
55
types: [opened, reopened, edited, closed]
66

77
jobs:
8+
screenshot-enforcement:
9+
name: Screenshot Enforcement
10+
if: github.event.action == 'opened' && github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
steps:
15+
- uses: actions/github-script@v8
16+
with:
17+
script: |
18+
const body = context.payload.pull_request.body ?? '';
19+
if (!body.includes('build:typescript') && !body.includes('Verification')) return;
20+
21+
await github.rest.pulls.update({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
pull_number: context.payload.pull_request.number,
25+
state: 'closed',
26+
});
27+
28+
await github.rest.issues.createComment({
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
issue_number: context.payload.pull_request.number,
32+
body: "You're allowed to open PRs only if you post a screenshot of your working PR. Untested AI PRs are NOT welcome here and you will get blocked.",
33+
});
34+
835
reminder:
936
name: Label Reminder
1037
if: github.event.pull_request.merged == true

0 commit comments

Comments
 (0)