Skip to content

fix(compare-actions): flag tag mismatch as outdated even when SHAs match#6

Merged
nerdalytics merged 1 commit into
trunkfrom
fix/compare-tag-mismatch
Apr 20, 2026
Merged

fix(compare-actions): flag tag mismatch as outdated even when SHAs match#6
nerdalytics merged 1 commit into
trunkfrom
fix/compare-tag-mismatch

Conversation

@nerdalytics
Copy link
Copy Markdown
Owner

A pin of @<sha> # v1 against an action whose latest release is v1.0.0 was being reported as Up to date: (v1) because the SHAs coincided (the v1 floating tag currently points to v1.0.0's commit). The consumer's pin label never got refreshed — logs showed the stale alias, and the auto-update PR never fired.

Observed during tinywhale pilot: the action reported itself as "Up to date: (v1)" even though v1.0.0 is the explicit release — the pin comment should be v1.0.0, not v1.

Fix

In compare-actions.sh: treat current_tag != latest_tag as outdated even when SHAs match (but only when both tags are non-empty, so consumers who pin without a # comment aren't affected).

apply-updates.sh already writes both SHA and tag on rewrite, so the resulting PR cleanly refreshes # v1# v1.0.0 (and # v1.0.0# v1.0.1 on next release).

Tests

Three new bats cases in compare-actions.bats:

  • Flags outdated when SHAs match but tags differ (the exact case from the pilot)
  • Up-to-date when both SHAs and tags match exactly (regression guard)
  • Up-to-date when SHAs match and current_tag is empty (pins without # comment)

Rollout

After merge: cut v1.0.1, re-point floating v1, publish Release. The next scheduled run in beacon/tinywhale will then auto-open a PR refreshing their # v1 pins to # v1.0.1.

Previously, a pin of '@<sha> # v1' against an action whose latest
release is 'v1.0.0' was reported as 'Up to date: (v1)' because the
SHAs coincided (v1 floating tag currently points to v1.0.0's commit).
The consumer's pin label never got refreshed, so logs showed the stale
alias and the auto-update PR never fired.

Now: current_tag != latest_tag triggers outdated-flag even with
matching SHAs. apply-updates.sh already writes both sha + tag on
rewrite, so the resulting PR cleanly updates '# v1' -> '# v1.0.0'
(and '# v1.0.0' -> '# v1.0.1' when the next release arrives).

Added bats coverage:
- flags outdated when SHAs match but tags differ (the exact case here)
- up-to-date when both SHAs and tags match exactly (regression guard)
- up-to-date when SHAs match and current_tag is empty (empty-comment case
  where tag comparison is skipped)
@nerdalytics nerdalytics merged commit 910163e into trunk Apr 20, 2026
3 checks passed
@nerdalytics nerdalytics deleted the fix/compare-tag-mismatch branch April 20, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant