Skip to content

Pin Psalm for the scan, and don't release from pull requests - #226

Merged
cs1m0n merged 2 commits into
masterfrom
fix/ci-psalm-pin-and-pr-releases
Oct 13, 2026
Merged

cs1m0n merged 2 commits into
masterfrom
fix/ci-psalm-pin-and-pr-releases

Conversation

@cs1m0n

@cs1m0n cs1m0n commented Oct 13, 2026

Copy link
Copy Markdown
Member

Changes

Scan (php-sast.yml). The scan has failed on every run since 9 October. The psalm/psalm-github-actions action runs its Docker image without a tag, so it always uses the latest Psalm. That is now 7.0.0-rc1, which crashes in humanmade/psalm-plugin-wordpress (a TypeError at Plugin.php:1064) before analyzing anything.

  • Psalm now comes from Composer, pinned to ^6.0, and runs with the same options as the action: --output-format=github --taint-analysis --report=results.sarif.
  • PHP is pinned to 8.4 with shivammathur/setup-php, itself pinned to the 2.40.0 commit. The PHP version decides which Psalm 6.x Composer picks: on the runner's PHP 8.3.6 it's 6.5.0, which refuses to start below PHP 8.3.16. On PHP 8.4 it's 6.20.0.
  • The workflow now also runs when its own file changes, so this pull request tests it.

Plugin release workflows. On pull requests, the build job tried to bump the version, then commit and push a release, which always failed (exit 128). It now builds the plugin and stops before the version bump, so pull requests still check that the plugin builds. The Create Release step is skipped on pull requests. Pushes to master and manual runs release as before.

Merging

Each release workflow also runs when its own file changes on master. A normal merge would start all six from the same commit: one would release a plugin with no code changes, and the others would fail on git push. Please merge with [skip ci] in the merge commit message.

Testing

  • Locally, with the workflow's exact config and commands on PHP 8.4, Psalm 6.20.0 reports no issues on current master and writes a valid SARIF report.
  • A deliberately planted echo $_GET[...] fails the scan with TaintedHtml.
  • A Composer dry run picks Psalm 6.5.0 on PHP 8.3.6 and 6.20.0 on PHP 8.4.
  • The build scripts ran under bash -eo pipefail on GNU/Linux, with yarn, git and zip stubbed. As a pull request, the job builds and stops with no git calls. A push or a manual run releases as before.
  • actionlint reports no new warnings. The existing tags-ignore and set-output warnings are unchanged.

🤖 Generated with Claude Code

- php-sast.yml: run Psalm 6 from Composer on PHP 8.4 instead of the
  psalm-github-actions Docker image, which always uses the latest Psalm.
  Its 7.0.0-rc1 crashes with humanmade/psalm-plugin-wordpress, so the
  scan failed on every run. The workflow now also runs when it changes.
- Plugin release workflows: on pull requests, the build job still builds
  the plugin, but stops before the version bump, commit, push and
  release, which always failed there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@cs1m0n cs1m0n self-assigned this Oct 13, 2026
@cs1m0n
cs1m0n requested a balanced review from Copilot October 13, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Psalm findings currently prevent the generated SARIF report from being uploaded.

1 open finding
What changed in this PR

Pins Psalm 6 on PHP 8.4 and prevents plugin releases from pull-request workflows.

Changes:

  • Installs and runs Psalm through Composer.
  • Builds or validates plugins on pull requests without versioning or release creation.
  • Preserves releases for master pushes and manual runs.
File Description
.github/​workflows/​php-sast.yml Pins PHP and Psalm scan dependencies.
.github/​workflows/​bcc-post-update-translations-notifier-plugin-release.yml Skips PR releases.
.github/​workflows/​bcc-login-plugin-release.yml Skips PR releases.
.github/​workflows/​bcc-keep-translated-posts-status-same-as-original-plugin-release.yml Skips PR releases.
.github/​workflows/​bcc-image-ocr-with-openai-plugin-release.yml Skips PR releases.
.github/​workflows/​bcc-generate-summary-with-ai-plugin-release.yml Skips PR releases.
.github/​workflows/​bcc-attachments-rss-feed-plugin-release.yml Skips PR releases.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/php-sast.yml
…ings

- Release workflows: when one push to master releases several plugins,
  their runs race to push their version bumps and only the first got
  through. A run now rebases onto the bumps pushed in the meantime and
  retries, and fails clearly, before zipping and releasing, if it still
  can't push.
- Release workflows: set the release tag through $GITHUB_OUTPUT instead
  of the deprecated ::set-output command.
- Scan: also upload the SARIF report when Psalm found issues, so they
  show up in code scanning. The check still fails.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@cs1m0n
cs1m0n merged commit 4673b77 into master Oct 13, 2026
17 checks passed
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.

2 participants