chore: keep only the newest 5 dev prereleases

This commit is contained in:
Julian Sommer
2026-10-13 11:45:32 +10:00
parent 7e008c4689
commit abb3da8af2
+2 -6
View File
@@ -167,11 +167,7 @@ jobs:
# Kept rather than unbounded: the Worker reads the first page of releases to
# resolve the channel, so enough prereleases would eventually push the real
# ones off it, and each build carries two assets.
#
# Twenty, not five. A pinned dev tag is how an external evaluator installs a
# specific build, and five is about a week of them -- short enough that the tag
# someone was given stops resolving while they are still using it.
# ones off it. Five leaves a few recent builds to roll back to.
- name: Prune old dev prereleases
if: steps.version.outputs.exists != 'true'
env:
@@ -179,7 +175,7 @@ jobs:
run: |
set -euo pipefail
gh api "repos/$GITHUB_REPOSITORY/releases?per_page=100" \
--jq 'map(select(.prerelease and (.tag_name | endswith("-dev")))) | .[20:] | .[].tag_name' \
--jq 'map(select(.prerelease and (.tag_name | endswith("-dev")))) | .[5:] | .[].tag_name' \
> stale.txt
while read -r tag; do
[ -n "$tag" ] || continue