Skip to content

fix(ci): require shasum match on release PR - #233

Merged
stanleyyconsensys merged 6 commits into
mainfrom
fix/release-pr-not-skip-shasum-diff
Aug 28, 2026
Merged

fix(ci): require shasum match on release PR#233
stanleyyconsensys merged 6 commits into
mainfrom
fix/release-pr-not-skip-shasum-diff

Conversation

@stanleyyconsensys

@stanleyyconsensys stanleyyconsensys commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Explanation

This PR updates the CI workflows to enforce that snap.manifest.json (including its shasum) matches the built output for release PRs, by restoring build artifacts and running a strict “clean working directory” check only when a PR is detected as a release.

Changes:

Expose a IS_RELEASE_PR output from the check-release job/action for downstream gating.
Add a require-correct-shasum job that restores build artifacts and fails if the working tree is dirty on release PRs (including shasum drift).
Include packages/*/snap.manifest.json in uploaded build artifacts and make the clean-workdir check configurable via skip-shasum-diff.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@stanleyyconsensys stanleyyconsensys changed the title fix: release pr check shasum fix: add shasum check on release pr Aug 28, 2026
@stanleyyconsensys stanleyyconsensys changed the title fix: add shasum check on release pr fix: add shasum dirty validation CI on release pr Aug 28, 2026
required: true

outputs:
IS_RELEASE_PR:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we need this to tell the main flow if it is release PR

# manifests so require-clean-release-pr can run a strict dirty check.
path: |
packages/*/dist
packages/*/snap.manifest.json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we need manifest to tell if it is a dirty or not

name: package-dist-${{ github.sha }}
path: packages
- name: Require clean working directory
if: needs.check-release.outputs.IS_RELEASE_PR == 'true'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we add needs.check-release.outputs.IS_RELEASE_PR == 'true' every step
becoz we dont wanna the whole step skip, and making the usual feature PR fail

messages[`error.${error.code}`]?.message ??
messages['error.internal']?.message ??
'Internal error';
'Internal error in Snap';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

dummy change to make the shasum dirty

@stanleyyconsensys stanleyyconsensys changed the title fix: add shasum dirty validation CI on release pr fix(CI): require shasum match on release pr Aug 28, 2026
@stanleyyconsensys
stanleyyconsensys marked this pull request as ready for review August 28, 2026 14:18
@stanleyyconsensys
stanleyyconsensys requested review from a team as code owners August 28, 2026 14:18
@stanleyyconsensys
stanleyyconsensys requested a lite review from Copilot August 28, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the CI workflows to enforce that snap.manifest.json (including its shasum) matches the built output for release PRs, by restoring build artifacts and running a strict “clean working directory” check only when a PR is detected as a release.

Changes:

  • Expose a IS_RELEASE_PR output from the check-release job/action for downstream gating.
  • Add a require-correct-shasum job that restores build artifacts and fails if the working tree is dirty on release PRs (including shasum drift).
  • Include packages/*/snap.manifest.json in uploaded build artifacts and make the clean-workdir check configurable via skip-shasum-diff.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/main.yml Adds check-release output plumbing and a new job to enforce strict manifest/shasum cleanliness for release PRs.
.github/workflows/lint-build-test.yml Uploads built snap.manifest.json files alongside dist/ so downstream jobs can verify post-build drift.
.github/actions/require-clean-working-directory/action.yml Adds an input to toggle whether shasum-only drift is ignored vs strictly enforced.
.github/actions/check-release/action.yml Exposes the “is release” determination as a composite-action output for workflow-level consumption.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 110 to 117
- name: Checkout repository
uses: actions/checkout@v7
- name: Check release
id: check-release
if: github.event_name != 'push'
uses: ./.github/actions/check-release
with:
commit-starts-with: ${{ vars.RELEASE_COMMIT_PREFIX }}

@stanleyyconsensys stanleyyconsensys Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is out of scope for this PR, as the PR didnt touch it

Comment thread .github/actions/require-clean-working-directory/action.yml Outdated
@ulissesferreira ulissesferreira changed the title fix(CI): require shasum match on release pr fix(ci): require shasum match on release PR Aug 28, 2026
@stanleyyconsensys
stanleyyconsensys added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit 524e812 Aug 28, 2026
54 checks passed
@stanleyyconsensys
stanleyyconsensys deleted the fix/release-pr-not-skip-shasum-diff branch August 28, 2026 14:51
@ulissesferreira ulissesferreira mentioned this pull request Aug 28, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants