fix branch cleanup burning GH API requests (#38392)

* ci: stop branch cleanup from burning API rate limit

* simpler
This commit is contained in:
Daniel Koepping
2026-07-20 16:00:20 -07:00
committed by GitHub
parent c20263d985
commit b1f2e638de
+8
View File
@@ -89,6 +89,14 @@ jobs:
const { owner, repo } = context.repo;
const upstream = `${owner}/${repo}`;
const closed = context.payload.pull_request;
if (closed) {
if (closed.head.repo?.full_name === upstream) {
await github.rest.git.deleteRef({ owner, repo, ref: `heads/${closed.head.ref}` }).catch(console.log);
}
return;
}
for await (const response of github.paginate.iterator(github.rest.pulls.list, {
owner,
repo,