github actions

This commit is contained in:
Jarred Sumner
2025-08-30 19:43:20 -07:00
parent fa4822f8b8
commit 46ce975175

View File

@@ -51,18 +51,37 @@ jobs:
permissions: permissions:
issues: write issues: write
pull-requests: write pull-requests: write
contents: write
steps: steps:
- name: Update PR title and body for slop - name: Update PR title and body for slop and close
uses: actions/github-script@v7 uses: actions/github-script@v7
with: with:
script: | script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
await github.rest.pulls.update({ await github.rest.pulls.update({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
pull_number: context.issue.number, pull_number: context.issue.number,
title: 'ai slop', title: 'ai slop',
body: 'This PR has been marked as AI slop and the description has been updated to avoid confusion or misleading reviewers. Many AI PRs are fine, but sometimes they submit a PR too early or just don\'t test anything and come to a completely wrong assumption.' body: 'This PR has been marked as AI slop and the description has been updated to avoid confusion or misleading reviewers.\n\nMany AI PRs are fine, but sometimes they submit a PR too early, fail to test if the problem is real, fail to reproduce the problem, or fail to test that the problem is fixed. If you think this PR is not AI slop, please leave a comment.',
state: 'closed'
}); });
// Delete the branch if it's from a fork or if it's not a protected branch
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${pr.data.head.ref}`
});
} catch (error) {
console.log('Could not delete branch:', error.message);
}
on-labeled: on-labeled:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event.label.name == 'crash' || github.event.label.name == 'needs repro' if: github.event.label.name == 'crash' || github.event.label.name == 'needs repro'