mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-23 01:13:44 +08:00
fix branch cleanup burning GH API requests (#38392)
* ci: stop branch cleanup from burning API rate limit * simpler
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user