Repository navigation
ci: harden GitHub Actions workflows - #362
Merged
Merged
Conversation
Declare `permissions: contents: read` at the workflow level so jobs that don't need more get a read-only token. Jobs that push, comment or publish keep their explicit job-level grants. The repository default is now read-only too, with Actions no longer allowed to approve pull requests.
Every job now has a timeout-minutes sized from observed run times (CI jobs 5-15 min, image builds 30-90 min, deploys 20 min) instead of the 6-hour default. Pull request workflows cancel the previous run of the same PR when a new commit is pushed; runs on push are never cancelled.
Coverage: 100.00% (460/460)All files
Line coverage from PHPUnit (PHP 8.5, latest dependencies). |
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.
GitHub Actions hardening from a workflow audit across the SILARHI / personal repositories. One commit per change:
permissions:block now getcontents: read; jobs that push, comment or publish keep their explicit job-level grants. The repository default token is also read-only now, and Actions can no longer approve pull requests (already applied in the repo settings).timeout-minutessized from observed run times (CI 5-15 min, image builds 30-90 min, deploys 20 min) instead of the 6-hour default, and pull request workflows cancel the previous run of the same PR (push runs are never cancelled).