ci: reconcile anvil artifacts on Dependabot branches - #108
Draft
Evgenii (Vaiz) wants to merge 2 commits into
Draft
ci: reconcile anvil artifacts on Dependabot branches#108Evgenii (Vaiz) wants to merge 2 commits into
Evgenii (Vaiz) wants to merge 2 commits into
Conversation
Dependabot cannot run a binary, so a pull request that bumps a GitHub Action leaves cargo-anvil's emitted tree and .anvil.lock stale. Merging one as-is is worse than useless: anvil keys each artifact on disk-vs-lock and template-vs-lock, so an edit it did not make marks the file as repository-customized and it stops updating that file for good. Add an anvil-regen workflow that reconciles those branches. It restores the emitted files to their base-branch state so the bump takes anvil's plain overwrite path, re-runs the generator, refreshes the insta snapshots, and pushes the result back onto the Dependabot branch. It runs on a schedule because workflows initiated by Dependabot get a read-only token and no secrets, and it needs its own push token because commits pushed with GITHUB_TOKEN do not start check runs. Point Dependabot at the templates as well as the workflows, grouped by dependency name so both move in one pull request, and widen regenerate-check so drift on an anvil-owned file is visible on the pull request instead of only in the merge queue. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Match the repository's shell of record: the Justfile sets script-interpreter to pwsh, so the recipes CI already runs are PowerShell. Set it as the workflow-level default rather than per step. The rewrite also drops two bash-isms that had no PowerShell counterpart and were carrying risk: jq string-wrapping to build the matrix JSON (ConvertTo-Json -InputObject does it without unrolling a single-element array), and `git diff --cached --quiet`, whose exit code 1 means "there are changes" and would have been read as a failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (99.9%) is below the target coverage (100.0%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
=====================================
Coverage 99.9% 99.9%
=====================================
Files 135 135
Lines 17449 17449
=====================================
Hits 17448 17448
Misses 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Dependabot cannot run a binary, so a pull request that bumps a GitHub Action leaves cargo-anvil's emitted tree and .anvil.lock stale. Merging one as-is is worse than useless: anvil keys each artifact on disk-vs-lock and template-vs-lock, so an edit it did not make marks the file as repository-customized and it stops updating that file for good.
Add an anvil-regen workflow that reconciles those branches. It restores the emitted files to their base-branch state so the bump takes anvil's plain overwrite path, re-runs the generator, refreshes the insta snapshots, and pushes the result back onto the Dependabot branch. It runs on a schedule because workflows initiated by Dependabot get a read-only token and no secrets, and it needs its own push token because commits pushed with GITHUB_TOKEN do not start check runs.
Point Dependabot at the templates as well as the workflows, grouped by dependency name so both move in one pull request, and widen regenerate-check so drift on an anvil-owned file is visible on the pull request instead of only in the merge queue.