CI: harden workflow triggers, action pins and timeouts - #14
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Hardens
.github/workflows/main.ymlafter two rounds of review on dependabot's checkout bump. Supersedes #13:actions/checkoutis pinned here at v7.0.1's commit SHA, which is the bump that PR was making.What changed
Supply chain
actions/checkoutis pinned by commit SHA (3d3c42e, v7.0.1) instead of the mutablev7tag, so a repointed upstream tag cannot change what runs without a diff in this repo. Dependabot maintains SHA pins and the trailing version comment together.ruby/setup-rubydeliberately stays on@v1, the reference upstream documents. A pinned release only knows the Ruby builds it shipped with, so pinning it would make the Ruby 4.0 matrix entry planned in ROADMAP 5.2 fail with an unhelpful unknown-version error. The reason is recorded in a comment next to the pin.persist-credentials: false. No step needs git credentials, and the next step has bundler evaluate gemspec and native-extension code from the branch under test.Triggers
pushis scoped tobranches: [master]. Every branch pushed to this repo was previously building twice, once per event: PR Bump actions/checkout from 5 to 7 #13's head produced two full runs and 16 checks where 8 would do.scheduleplusworkflow_dispatch.bundler-auditis the only job that can report something new about a tree nobody has touched, so the schedule exists for it andtestand the rubocop leg are skipped on that trigger.workflow_dispatchis the on-demand path and also how the cron gets re-armed, since GitHub disables scheduled workflows after 60 days without repository activity.concurrencygroup cancels superseded runs, but only forpull_request. Cancelling amasterrun would leave that commit recorded as cancelled rather than green or red, and would kill the run that populates the cache PR runs restore from.Jobs
lintandauditwere byte-identical apart from the job name and onerun, so they are now onechecksmatrix job. Check names are unchanged (rubocop,bundler-audit).timeout-minutes: 30on both jobs, replacing the six-hour default. Chosen above a cold-cache install rather than from the 10-20s warm runs, because every dependabot lockfile bump misses the bundler cache and installs a full Rails tree from source.Docs
CHANGELOG.mdgets an[Unreleased]entry. 1.6.0 recorded its CI work the same way.main.yml:15-21for the six Ruby/Rails pairs, which moved to lines 47-52, and its recommended solution still listed thepermissionsandconcurrencywork as outstanding.For the reviewer
includeexpression, because a job-levelifcannot see thematrixcontext andexcludedoes not removeincludeentries. The YAML parses and the folded scalar resolves to the expression intended, but whether GitHub evaluates it into the right legs is only provable by a run. Please confirm the PR run produces exactlyrubocopandbundler-audit, and that the first scheduled or manually dispatched run producesbundler-auditalone.bundle exec ...commands now live in the matrix rather than on arun:line, and the audit step's descriptive name ("Check the lockfile against the advisory database") became "Run bundler-audit". A comment in the matrix block carries that explanation instead.pushtomastermeans a branch pushed without an open PR gets no CI. That is the intended trade for removing the duplicate runs.@v7tag back over the SHA pin.🤖 Generated with Claude Code