We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61b4f82 commit 9709c59Copy full SHA for 9709c59
1 file changed
.github/workflows/retire-branch.yml
@@ -140,9 +140,12 @@ jobs:
140
echo "Branch: $BRANCH"
141
echo ""
142
143
- # Look for an existing "Retired Branch Lock" ruleset on this repo.
+ # Look for an existing repo-level ruleset with this name.
144
+ # Filtering by source_type=="Repository" avoids matching org-level rulesets
145
+ # (which also appear in this list but cannot be patched via the repo API).
146
RULESET_ID=$(gh api "repos/${REPO}/rulesets" \
- | jq -r --arg name "$RULESET_NAME" '.[] | select(.name == $name) | .id')
147
+ | jq -r --arg name "$RULESET_NAME" \
148
+ '.[] | select(.name == $name and .source_type == "Repository") | .id')
149
150
if [[ -z "$RULESET_ID" ]]; then
151
echo "No existing '${RULESET_NAME}' ruleset found — creating one."
0 commit comments