Created
May 23, 2024 19:06
-
-
Save goatgoose/05ae12b51a4739869323a5b61e54c1c7 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
purge_before_date="2022-01-01" | |
labels_to_remove=("priority/high", "priority/medium") | |
for label in "${labels_to_remove[@]}"; do | |
echo "Removing ${label} labels:" | |
echo "" | |
issues_json=$(gh issue list -S "is:open is:issue label:${label} created:<${purge_before_date}" --limit 200 --json number,title) | |
while read issue_json; do | |
number=$(echo "${issue_json}" | jq -r ".number") | |
title=$(echo "${issue_json}" | jq -r ".title") | |
gh issue edit "${number}" --remove-label "${label}" | |
echo "${number}: ${title}" | |
sleep 1 | |
done < <(echo "${issues_json}" | jq -c ".[]") | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment