Skip to content

Fix GitHub Actions workflow linter findings - #166

Merged
ondrejmirtes merged 1 commit into
mainfrom
fix-workflow-lint-findings
Nov 7, 2026
Merged

ondrejmirtes merged 1 commit into
mainfrom
fix-workflow-lint-findings

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Runs every linter from lint-workflows.yml locally (actionlint 1.7.12 with shellcheck, octoscan, poutine 1.1.4, zizmor 1.31.1 --persona=auditor) and fixes what they report. Before this change: actionlint 0, octoscan 10, poutine 12, zizmor 35 findings. After it: 0 for all four.

Fixes

  • send-pr.yml: github.ref_name was expanded straight into a run: script (template injection). It is now passed through env. The old version used to be written to $GITHUB_OUTPUT; the PR body is now written to $RUNNER_TEMP/pr-body.md and passed with body-path, so the PR body stays the same.
  • persist-credentials: false on every checkout whose git credentials nothing uses. The one exception is "Checkout to commit" in update.yml, because git-auto-commit-action pushes with those credentials. It keeps them and has an inline zizmor ignore. create-pull-request sets its own auth from its token input, so send-pr does not need the persisted credentials either.
  • update.yml: adds permissions: contents: read. All pushes use PHPSTAN_BOT_TOKEN, so GITHUB_TOKEN only needs read access. Also removes ref: ${{ github.head_ref }}, which was always empty because that step never runs on pull_request.
  • concurrency on all workflows. Lint, PHPStan, lock-issues and update PR runs cancel superseded runs. Update runs on main, release and send-pr runs queue instead, so a commit, tag, release or PR is never cut off halfway.
  • actionlint now runs from the rhysd/actionlint Docker image pinned by digest (1.7.12), instead of bash <(curl …/main/…). This matches the current upstream johnbillion/plugin-infrastructure config, and the image includes shellcheck. The problem matcher is still registered.
  • setup-php version comments now say # 2.40.0 (the real tag name). The actionlint and lock jobs now have names; the actionlint check name does not change.

Suppressions (reviewed false positives)

  • .github/zizmor.yml: secrets-outside-env for the bot token (fixing it means moving the secret into deployment environments, which is a repo settings change), and superfluous-actions for gh-release, create-pull-request and git-auto-commit.
  • .github/poutine.yml: github_action_from_unverified_creator_used for the listed SHA-pinned actions.
  • octoscan ignore for "checkout with a custom ref". Its static-ref regex is ^[a-zA-Z-]+$, so it flags the fixed branch names PHP-8.x and 2.3.x.

- Fix template injection of github.ref_name in send-pr.yml
- Write the PR body to a file instead of a step output
- Set persist-credentials: false wherever git credentials are not needed
- Add explicit permissions to update.yml and concurrency to all workflows
- Run actionlint from its digest-pinned Docker image instead of curl | bash
- Drop the always-empty head_ref checkout ref in update.yml
- Correct setup-php version comments (tag is 2.40.0) and name unnamed jobs
- Add zizmor, poutine and octoscan suppressions for reviewed false positives

Amp-Thread-ID: https://ampcode.com/threads/T-01a197a7-55dd-77bd-9417-0623abc54212
@ondrejmirtes
ondrejmirtes merged commit 1541f8d into main Nov 7, 2026
9 checks passed
@ondrejmirtes
ondrejmirtes deleted the fix-workflow-lint-findings branch November 7, 2026 10:29
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