Skip to content

Commit bae0bcb

Browse files
cliffhallclaude
andcommitted
ci(everything): diff a Release against the previous Release (#4860)
`git describe` finds the nearest ancestor tag, but the date-stamped releases tagged commits that never reached main, so from main it lands on typescript-servers-0.6.2 (2024). Take the previous published Release's tag from the Releases list instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent 1d25537 commit bae0bcb

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

‎.github/workflows/everything-mcp-diff.yml‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ on:
4848
- "scripts/interface-diff.mjs"
4949
- ".github/workflows/everything-mcp-diff.yml"
5050
# A published Release (a milestone, tagged vX.Y.Z on main; see RELEASING.md)
51-
# surfaces the cumulative interface delta since the previous release's tag.
51+
# surfaces the cumulative interface delta since the previous Release. This
52+
# replaces #3260's `typescript-servers-*` tag trigger: those tags stopped in
53+
# 2024, and no release since has used them.
5254
release:
5355
types: [published]
5456
# Manual trigger for comparing any two refs (commits, tags, branches)
@@ -84,7 +86,7 @@ jobs:
8486
uses: actions/checkout@v6
8587
with:
8688
# The base is built from history, so all of it is needed, tags
87-
# included (the release base is the previous tag).
89+
# included (the release base is the previous Release's tag).
8890
fetch-depth: 0
8991
ref: ${{ inputs.target_ref || github.ref }}
9092
persist-credentials: false
@@ -106,6 +108,9 @@ jobs:
106108
PR_BASE: ${{ github.event.pull_request.base.sha }}
107109
BEFORE: ${{ github.event.before }}
108110
INPUT_BASE: ${{ inputs.compare_ref }}
111+
TAG: ${{ github.event.release.tag_name }}
112+
REPO: ${{ github.repository }}
113+
GH_TOKEN: ${{ github.token }}
109114
run: |
110115
case "$EVENT" in
111116
# The checkout is the PR's merge commit, so its base tip is
@@ -118,7 +123,14 @@ jobs:
118123
else
119124
base=$(git rev-parse HEAD^)
120125
fi ;;
121-
release) base=$(git describe --tags --abbrev=0 HEAD^) ;;
126+
# The previous published Release's tag. Not `git describe`: the
127+
# date-stamped releases tagged commits that never reached main, so
128+
# the nearest ancestor tag is years older than the last release.
129+
release)
130+
base=$(gh release list --repo "$REPO" --exclude-drafts --exclude-pre-releases --limit 50 \
131+
--json tagName,publishedAt \
132+
--jq "map(select(.tagName != \"$TAG\")) | sort_by(.publishedAt) | last | .tagName // empty")
133+
if [ -z "$base" ]; then echo "no earlier Release to compare against" >&2; exit 1; fi ;;
122134
workflow_dispatch)
123135
if [ -n "$INPUT_BASE" ]; then
124136
base="$INPUT_BASE"

0 commit comments

Comments
 (0)