Skip to content

Instantly share code, notes, and snippets.

@ponfertato
Last active January 13, 2026 13:52
Show Gist options
  • Select an option

  • Save ponfertato/10a09fc5cf46e42c8fa4be014671362e to your computer and use it in GitHub Desktop.

Select an option

Save ponfertato/10a09fc5cf46e42c8fa4be014671362e to your computer and use it in GitHub Desktop.
Delete issues in github repo that have any of specified labels and were created before 2025-12-31 23:59:59
REPO="potatoenergy/status"
LABELS='mindustry-server,mindustry-server-port,minecraft-server,minecraft-server-port'
CUTOFF="2025-12-31T23:59:59Z"
gh issue list --repo "$REPO" --state all --limit 1000 --json number,createdAt,labels | jq -r --arg labels "$LABELS" --arg cutoff "$CUTOFF" '($labels|split(",")) as $arr | .[] | .labels = (.labels//[]) | select((.createdAt < $cutoff) and any(.labels[]; (.name|ascii_downcase) as $n | ($arr[]|ascii_downcase) == $n)) | .number' | while read -r n; do gh issue delete "$n" --repo "$REPO" --yes; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment