Skip to content

ci: harden GitHub Actions workflows - #362

Merged
guillaume-sainthillier merged 2 commits into
6.xfrom
ci/harden-github-actions
Oct 2, 2026
Merged

guillaume-sainthillier merged 2 commits into
6.xfrom
ci/harden-github-actions

Conversation

@guillaume-sainthillier

Copy link
Copy Markdown
Member

GitHub Actions hardening from a workflow audit across the SILARHI / personal repositories. One commit per change:

  • ci: restrict the default GITHUB_TOKEN to read-only: Workflows without a permissions: block now get contents: 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).
  • ci: bound job run times and cancel superseded pull request runs: Every job gets a timeout-minutes sized 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).

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.
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Coverage: 100.00% (460/460)

All files
File Lines Δ
src/Banking/Balance.php 100.00% (7/7)
src/Banking/Element.php 100.00% (0/0)
src/Banking/Header.php 100.00% (14/14)
src/Banking/Noop.php 100.00% (0/0)
src/Banking/Operation.php 100.00% (18/18)
src/Banking/OperationDetail.php 100.00% (10/10)
src/Banking/Statement.php 100.00% (15/15)
src/Banking/Total.php 100.00% (15/15)
src/Banking/Transaction.php 100.00% (19/19)
src/Banking/Transfer.php 100.00% (10/10)
src/Cfonb120Reader.php 100.00% (28/28)
src/Cfonb240Reader.php 100.00% (24/24)
src/CfonbCodes.php 100.00% (0/0)
src/CfonbReader.php 100.00% (3/3)
src/Contracts/ParserInterface.php 100.00% (0/0)
src/Exceptions/BalanceUnavailableException.php 100.00% (0/0)
src/Exceptions/HeaderUnavailableException.php 100.00% (0/0)
src/Exceptions/KeyDoesNotExistException.php 100.00% (1/1)
src/Exceptions/ParseException.php 100.00% (0/0)
src/Exceptions/TotalUnavailableException.php 100.00% (0/0)
src/Exceptions/ValueOfKeyIsNotAStringException.php 100.00% (1/1)
src/Exceptions/ValueOfKeyIsNotNumericException.php 100.00% (1/1)
src/Parser/AmountParser.php 100.00% (7/7)
src/Parser/Cfonb120/AbstractCfonb120Parser.php 100.00% (1/1)
src/Parser/Cfonb120/Line01Parser.php 100.00% (27/27)
src/Parser/Cfonb120/Line04Parser.php 100.00% (41/41)
src/Parser/Cfonb120/Line05Parser.php 100.00% (30/30)
src/Parser/Cfonb120/Line07Parser.php 100.00% (1/1)
src/Parser/Cfonb240/AbstractCfonb240Parser.php 100.00% (1/1)
src/Parser/Cfonb240/Line31Parser.php 100.00% (37/37)
src/Parser/Cfonb240/Line34Parser.php 100.00% (47/47)
src/Parser/Cfonb240/Line39Parser.php 100.00% (40/40)
src/Parser/DateParser.php 100.00% (4/4)
src/Parser/EmptyParser.php 100.00% (2/2)
src/Parser/FileParser.php 100.00% (12/12)
src/Parser/LineParser.php 100.00% (8/8)
src/Parser/MoneyParser.php 100.00% (1/1)
src/Parser/RegexMatch.php 100.00% (30/30)
src/Parser/RegexParts.php 100.00% (5/5)

Line coverage from PHPUnit (PHP 8.5, latest dependencies).

@guillaume-sainthillier
guillaume-sainthillier merged commit 6ce2645 into 6.x Oct 2, 2026
15 checks passed
@guillaume-sainthillier
guillaume-sainthillier deleted the ci/harden-github-actions branch October 2, 2026 08:30
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.

1 participant