[Github] Make prune-unused-branches only delete branches after 7 days#205438
Merged
boomanaiden154 merged 2 commits intoJun 23, 2026
Conversation
Created using spr 1.3.7
|
@llvm/pr-subscribers-github-workflow Author: Aiden Grossman (boomanaiden154) ChangesTo hopefully prevent the last failure mode that led to the job being Full diff: https://github.com/llvm/llvm-project/pull/205438.diff 1 Files Affected:
diff --git a/.github/workflows/prune-unused-branches.py b/.github/workflows/prune-unused-branches.py
index 3115b4424fb57..25b3146936b46 100644
--- a/.github/workflows/prune-unused-branches.py
+++ b/.github/workflows/prune-unused-branches.py
@@ -1,3 +1,4 @@
+import datetime
import subprocess
import sys
import os
@@ -165,8 +166,14 @@ def get_branches_found_in_previous_run(github_token: str) -> list[str]:
for workflow_run in iter(
repo.get_workflow("prune-branches.yml").get_runs(branch="main")
):
- if workflow_run.status == "completed":
- break
+ if not workflow_run.status == "completed":
+ continue
+ cutoff = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(
+ days=7
+ )
+ if workflow_run.run_started_at > cutoff:
+ continue
+ break
assert workflow_run
workflow_artifact = None
for workflow_artifact in iter(workflow_run.get_artifacts()):
|
cmtice
reviewed
Jun 23, 2026
| ) | ||
| if workflow_run.run_started_at > cutoff: | ||
| continue | ||
| break |
Contributor
There was a problem hiding this comment.
The 'break' is unconditional now; was that intended?
Contributor
Author
There was a problem hiding this comment.
Yes. We now early exit for all the conditions where we want to continue.
cmtice
approved these changes
Jun 23, 2026
llvm-upstreamsync Bot
pushed a commit
to qualcomm/cpullvm-toolchain
that referenced
this pull request
Jun 24, 2026
…fter 7 days To hopefully prevent the last failure mode that led to the job being disabled where the GitHub API failed to return results for >24 hours. Reviewers: cmtice Pull Request: llvm/llvm-project#205438
llvm-sync Bot
pushed a commit
to arm/arm-toolchain
that referenced
this pull request
Jun 24, 2026
…fter 7 days To hopefully prevent the last failure mode that led to the job being disabled where the GitHub API failed to return results for >24 hours. Reviewers: cmtice Pull Request: llvm/llvm-project#205438
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To hopefully prevent the last failure mode that led to the job being
disabled where the GitHub API failed to return results for >24 hours.