Skip to content

fix(ci): tighten PR workflow permissions and secret access (v1.6 backport)#902

Merged
robdecker merged 3 commits into
v1.6from
fix/ci-harden-pr-workflows-v1.6
May 11, 2026
Merged

fix(ci): tighten PR workflow permissions and secret access (v1.6 backport)#902
robdecker merged 3 commits into
v1.6from
fix/ci-harden-pr-workflows-v1.6

Conversation

@robdecker
Copy link
Copy Markdown
Member

@robdecker robdecker commented May 8, 2026

Summary

Backport of #901 to the v1.6 maintenance branch. Applies the same security mitigations to next-drupal.yml and release-pr.yml so this branch's PR-triggered workflows have the same hardened defaults.

next-drupal.yml

  • Switch from pull_request_target to pull_request
  • persist-credentials: false on checkout
  • permissions: contents: read at workflow root
  • Drupal secrets only loaded when github.event_name == 'push' to v1.6
  • PR runs skip integration tests that exercise a live Drupal instance (client.test, crud.test) and lift coverage threshold accordingly
  • concurrency cancel-in-progress + timeout-minutes: 15
  • Bump actions/checkout and actions/setup-node to v4
  • Pass placeholder DRUPAL_* env vars on PR runs (test utils construct a Drupal client at module load and require these to be present)

release-pr.yml

  • Trigger restricted to pull_request: [labeled]
  • Internal-PR guard: head.repo.full_name == base.repo.full_name
  • persist-credentials: false on checkout
  • setup-node@v4 registry-url + NODE_AUTH_TOKEN (replaces inline .npmrc echo)
  • Replace third-party comment action with built-in gh pr comment
  • permissions: contents: read, pull-requests: write
  • concurrency cancel-in-progress + timeout-minutes: 15

next.yml

  • Bump actions/cache@v2v4 (v2 is automatically failed by GitHub) and replace deprecated ::set-output syntax with $GITHUB_OUTPUT

Test plan

  • CI on this PR validates the new next-drupal.yml (PR path, integration tests skipped) — test job passes
  • Push-to-v1.6 path runs full test suite with Drupal secrets after merge
  • release-pr.yml validated on next experimental release attempt against this branch

Notes

The Drupal phpunit matrix jobs (Drupal 9.4, Drupal 9.5, Drupal 10.0) in next.yml show as failing on this PR. Those failures are pre-existing — they were already failing on v1.6 before this PR was opened and are unrelated to the security changes here. The matrix targets Drupal versions that are EOL upstream (Drupal 9.x reached EOL in late 2023; 10.0 reached EOL in late 2023), and the locked symfony/console version no longer satisfies current composer/composer requirements. Updating that matrix to currently-supported Drupal versions is a separate maintenance task and out of scope for this security fix.

The next-drupal test job (the workflow this PR actually hardens) passes.

…port)

Backport of #901. Same security mitigations applied to the v1.6
maintenance branch.

next-drupal.yml:
- Switch from pull_request_target to pull_request
- persist-credentials: false on checkout
- permissions: contents: read
- Gate Drupal secrets to push-to-v1.6 events only
- Add concurrency + timeout-minutes
- Bump checkout/setup-node to v4

release-pr.yml:
- Restrict trigger to internal-PR labeled events
- persist-credentials: false on checkout
- setup-node@v4 registry-url + NODE_AUTH_TOKEN
- Replace third-party comment action with gh CLI
- permissions: contents: read, pull-requests: write
- Add concurrency + timeout-minutes
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
next-drupal-next Ready Ready Preview, Comment May 8, 2026 11:56pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
next-drupal Ignored Ignored May 8, 2026 11:56pm
next-drupal-v1-6 Ignored Ignored May 8, 2026 11:56pm

Request Review

- Pass placeholder DRUPAL_USERNAME/PASSWORD/CLIENT_ID/CLIENT_SECRET
  on PR runs. Test utils construct a Drupal client at module load
  time and require these to be present (not valid).
- Bump actions/cache@v2 -> v4 in next.yml (v2 is automatically
  failed by GitHub) and replace deprecated ::set-output syntax with
  $GITHUB_OUTPUT.
tests/client.test.ts mixes unit and live-Drupal integration tests.
Without a clean split, all of them fail when pointed at the
placeholder DRUPAL_BASE_URL. Skip on PR runs; push-to-v1.6 still
runs the full suite against the live sandbox.
@robdecker robdecker merged commit 42a8725 into v1.6 May 11, 2026
8 of 14 checks passed
@robdecker robdecker deleted the fix/ci-harden-pr-workflows-v1.6 branch May 11, 2026 20:23
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