Skip to content

verify-action-build: handle source-detached orphan release tags#768

Merged
dave2wave merged 1 commit intomainfrom
verify-action-build-source-detached-tags
Apr 24, 2026
Merged

verify-action-build: handle source-detached orphan release tags#768
dave2wave merged 1 commit intomainfrom
verify-action-build-source-detached-tags

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Apr 24, 2026

Summary

  • Detect release tags whose tree is a rootless orphan commit containing only action.yml, dist/, LICENSE, README.md — no src/ and no package.json to rebuild from. Common with changesets-driven release flows (e.g. slackapi/slack-github-action v3.0.x).
  • Resolve the corresponding default-branch source commit via the GitHub Releases API: match tag → published_at → most recent default-branch commit at or just before published_at with a buildable package.json, preferring "chore: release"-style messages.
  • Docker build now captures /original-dist from the orphan tag, then git checkouts to the resolved source commit before building, so the rebuild runs against real source and the diff compares against the tag's published dist/.

Why

Currently verifier runs on slackapi/slack-github-action@v3.0.2 (PR #762) fail with "JS build verification: DIFFERENCES DETECTED" — but the actual cause is that the tag commit has no source at all, so the rebuild silently produces nothing. The failure message is misleading and blocks auto-approval of an otherwise-valid bump. Verified end-to-end:

  • slackapi/slack-github-action@v3.0.2 (03ea5433c137) → resolves to 90fee45e5a24 (main's "chore: release (gateway: bump sbt/setup-sbt from 1.1.20 to 1.1.22 #593)"), rebuilt dist/index.js + dist/sourcemap-register.cjs are byte-identical to the tag's published artifacts.
  • v3.0.1 (same pattern, already approved) also passes cleanly under the new path.
  • actions/checkout, astral-sh/setup-uv, scacap/action-surefire-report are not flagged as detached — detection is narrow (dist/ present, package.json + src/ absent, top-level only), so the normal build path is unchanged.

Test plan

Generated-by: Claude Opus 4.7 (1M context)

Some actions (e.g. slackapi/slack-github-action with its changesets-driven
release flow) publish their version tag as a rootless orphan commit whose
tree contains only distributable artifacts — action.yml, dist/, LICENSE,
README.md.  Consumers pin to that commit SHA, so the verifier clones it and
runs npm run build, but there is no src/ and no package.json at the tag
and the rebuild silently produces nothing, causing a misleading
"DIFFERENCES DETECTED" failure.

Detect that pattern and resolve the corresponding default-branch source
commit via the GitHub Releases API: find the tag(s) pointing at the
commit, read published_at, and pick the most recent default-branch commit
at or just before published_at that has a buildable package.json —
preferring "chore: release"-style messages (changesets / release-please /
Version Packages).  The Docker build then captures /original-dist from
the orphan tag and git-checkouts to the resolved source commit before
building, so the rebuild runs against real source and the diff is
against the tag's published dist.

The detection is narrow: only top-level tags whose tree has dist/ but no
package.json and no src/.  Monorepo sub-actions and normal actions are
untouched.  Verified end-to-end against slackapi/slack-github-action@
v3.0.2 (byte-identical rebuild) and v3.0.1, with regression checks on
actions/checkout, astral-sh/setup-uv, and scacap/action-surefire-report
(not flagged as detached, normal path preserved).
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Apr 24, 2026

This is apparently common practice that action is released from an Orphan tag that "only" contains compiled javascript - no sources. This change to our verify script should handle it.

@potiuk potiuk requested review from dave2wave, dfoulks1 and raboof April 24, 2026 11:31
Copy link
Copy Markdown
Member

@dave2wave dave2wave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a necessary new feature

@dave2wave dave2wave merged commit c3d4987 into main Apr 24, 2026
8 checks passed
@dave2wave dave2wave deleted the verify-action-build-source-detached-tags branch April 24, 2026 16:21
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.

2 participants