mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
github actions
This commit is contained in:
23
.github/workflows/labeled.yml
vendored
23
.github/workflows/labeled.yml
vendored
@@ -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'
|
||||||
|
|||||||
Reference in New Issue
Block a user