Skip to content

fix(init): remove stale head sha from CI snippets#248

Merged
zeitlinger merged 1 commit intomainfrom
codex/drop-head-sha
Apr 28, 2026
Merged

fix(init): remove stale head sha from CI snippets#248
zeitlinger merged 1 commit intomainfrom
codex/drop-head-sha

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

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, and GITHUB_TOKEN, while keeping fetch-depth: 0.

The missing-env failure/warning is intentionally deferred.

Validation

  • cargo fmt
  • cargo test generate_lint_workflow
  • mise run lint:fix
  • git diff --check

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review April 28, 2026 16:53
@zeitlinger zeitlinger requested a review from a team as a code owner April 28, 2026 16:53
Copilot AI review requested due to automatic review settings April 28, 2026 16:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yml to stop exporting GITHUB_HEAD_SHA and export GITHUB_REPOSITORY, GITHUB_BASE_REF, GITHUB_HEAD_REF, and PR_HEAD_REPO instead (plus GITHUB_TOKEN).
  • Extend the init workflow-generation test to assert the new env vars are present and GITHUB_HEAD_SHA is 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.

@zeitlinger zeitlinger merged commit d12f1b9 into main Apr 28, 2026
18 checks passed
@zeitlinger zeitlinger deleted the codex/drop-head-sha branch April 28, 2026 18:02
This was referenced May 8, 2026
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.

3 participants