fix(init): remove stale head sha from CI snippets#248
Merged
zeitlinger merged 1 commit intomainfrom Apr 28, 2026
Merged
Conversation
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the now-unused GITHUB_HEAD_SHA from generated CI snippets and updates the scaffolded/generated lint workflow to pass the GitHub env vars Flint’s link-remap logic actually consumes.
Changes:
- Update the init scaffold template for
.github/workflows/lint.ymlto stop exportingGITHUB_HEAD_SHAand exportGITHUB_REPOSITORY,GITHUB_BASE_REF,GITHUB_HEAD_REF, andPR_HEAD_REPOinstead (plusGITHUB_TOKEN). - Extend the init workflow-generation test to assert the new env vars are present and
GITHUB_HEAD_SHAis absent. - Update README and this repo’s lint workflow to match the new recommended env set.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/init/tests.rs |
Adds assertions for the new workflow env vars and verifies GITHUB_HEAD_SHA is no longer emitted. |
src/init/scaffold.rs |
Updates the generated lint.yml template env block to match Flint’s current GitHub link-remap inputs. |
README.md |
Updates the CI snippet and explanation to remove GITHUB_HEAD_SHA and document the new env vars. |
.github/workflows/lint.yml |
Aligns the repo’s own lint workflow with the new env vars used by Flint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
martincostello
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stops generated CI snippets and docs from exporting
GITHUB_HEAD_SHA, which Rust Flint no longer reads.The generated workflow now passes the GitHub link-remap environment Flint actually uses:
GITHUB_REPOSITORY,GITHUB_BASE_REF,GITHUB_HEAD_REF,PR_HEAD_REPO, andGITHUB_TOKEN, while keepingfetch-depth: 0.The missing-env failure/warning is intentionally deferred.
Validation
cargo fmtcargo test generate_lint_workflowmise run lint:fixgit diff --check