GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ci: skip content api tests for audit deps PRs (3.x) by denolfe · Pull Request #19300 · payloadcms/payload

Conversation

@denolfe

@denolfe denolfe commented Nov 3, 2026

Copy link
Copy Markdown
Member

Content API tests no longer run on bot PRs to 3.x. This is the 3.x half of the same gate in #19295, and it must merge before #19295.

Root Cause

  • A PR runs the main.yml of its base branch. Bot PRs to 3.x therefore use the 3.x copy, which skips only fork PRs.
  • tests-content-api assumes an AWS role and pulls a private ECR image.
  • The audit-deps PRs from ci: automatically create dep update PRs that fix GHSA findings #19295 run dependency versions no person has reviewed. On 3.x, that code would run with the AWS credentials.

Changes

  • tests-content-api condition (.github/workflows/main.yml)
    • The job also skips PRs opened by a bot account.
    • It also skips branches that start with ci/audit-deps-fix-, the prefix the audit workflow uses for its PRs.
    • The condition matches the one ci: automatically create dep update PRs that fix GHSA findings #19295 adds on main.

🤖 Written with AI

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@denolfe
ci: skip content api tests for bot PRs (3.x)
2b759a1
@github-actions github-actions Bot added created-by: Payload team v3 labels Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The tests-content-api workflow job now skips bot-authored pull requests and pull requests with head branches starting with ci/audit-deps-fix-. Its comment also mentions the AWS role assumption.

Changes: Content API workflow gating

Layer / File(s) Summary
Job conditions
.github/workflows/main.yml
The job condition adds bot-author and branch-prefix exclusions. The skip comment also mentions the AWS role assumption.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • payloadcms/payload#19295: Adds the same skip conditions to tests-content-api on main; this PR adds them on 3.x.

Suggested labels: v3

Suggested reviewers: germanjablo

Merge Risk: Minimal · up to 2b759

The workflow gating change has no established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly describes the main change: skipping Content API tests for audit dependency pull requests on the 3.x branch.
Description check Passed The description explains why the workflow changes and identifies the bot and branch conditions added to tests-content-api.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: payloadcms/payload
  • Branch: ci/content-api-skip-bot-prs-3x
  • File: .coderabbit.yaml
  • Commit: 2b759a1
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e70feb87-fadd-44ff-b0a1-da12e2f26715
Commits

Reviewing files that changed from the base of the PR and between 49b3c0b and 2b759a1.

Files selected for processing: 1
  • .github/workflows/main.yml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@denolfe denolfe changed the title ci: skip content api tests for bot PRs (3.x) ci: skip content api tests for audit deps PRs (3.x) Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖

Meta File Out File Size (raw) Note
packages/next/meta_index.json esbuild/index.js 1.00 MB 🆕 Added
packages/payload/meta_index.json esbuild/index.js 1.48 MB 🆕 Added
packages/payload/meta_shared.json esbuild/exports/shared.js 202.78 KB 🆕 Added
packages/richtext-lexical/meta_client.json esbuild/exports/client_optimized/index.js 291.15 KB 🆕 Added
packages/ui/meta_client.json esbuild/exports/client_optimized/index.js 1.20 MB 🆕 Added
packages/ui/meta_shared.json esbuild/exports/shared_optimized/index.js 16.32 KB 🆕 Added
Largest paths These visualization shows top 20 largest paths in the bundle.

Meta file: packages/next/meta_index.json, Out file: esbuild/index.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ████████████████████▌ }}}$ 82.4%, 820.17 KB
dist/views/Version ${{\color{Goldenrod}{ █▎ }}}$ 5.2%, 51.87 KB
dist/views/Dashboard ${{\color{Goldenrod}{ ▌ }}}$ 2.1%, 21.39 KB
dist/views/Document ${{\color{Goldenrod}{ ▍ }}}$ 1.7%, 16.71 KB
dist/views/List ${{\color{Goldenrod}{ ▎ }}}$ 1.1%, 11.42 KB
dist/views/Root ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 10.06 KB
dist/views/Versions ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 6.17 KB
dist/views/API ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 6.13 KB
dist/elements/Nav ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 5.96 KB
dist/views/Account ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 5.56 KB
dist/elements/DocumentHeader ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 4.84 KB
dist/views/ForgotPassword ${{\color{Goldenrod}{ }}}$ 0.4%, 4.45 KB
dist/views/Login ${{\color{Goldenrod}{ }}}$ 0.4%, 4.40 KB
dist/layouts/Root ${{\color{Goldenrod}{ }}}$ 0.3%, 3.19 KB
dist/views/CreateFirstUser ${{\color{Goldenrod}{ }}}$ 0.3%, 2.81 KB
dist/templates/Default ${{\color{Goldenrod}{ }}}$ 0.3%, 2.64 KB
dist/views/BrowseByFolder ${{\color{Goldenrod}{ }}}$ 0.3%, 2.61 KB
dist/views/CollectionFolders ${{\color{Goldenrod}{ }}}$ 0.2%, 2.44 KB
dist/views/ResetPassword ${{\color{Goldenrod}{ }}}$ 0.2%, 2.40 KB
dist/views/Logout ${{\color{Goldenrod}{ }}}$ 0.2%, 1.94 KB
(other) ${{\color{Goldenrod}{ ████▍ }}}$ 17.6%, 175.59 KB

Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ████████████████▋ }}}$ 66.7%, 985.26 KB
dist/collections/operations ${{\color{Goldenrod}{ ▊ }}}$ 3.4%, 49.88 KB
dist/fields/hooks ${{\color{Goldenrod}{ ▊ }}}$ 3.2%, 47.35 KB
dist/auth/operations ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 17.68 KB
dist/versions/migrations ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 17.43 KB
dist/globals/operations ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 14.90 KB
dist/fields/config ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 14.21 KB
dist/queues/operations ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 13.15 KB
dist/utilities/configToJSONSchema.js ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 13.13 KB
dist/utilities/telemetry ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 11.40 KB
dist/fields/validations.js ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 10.64 KB
dist/collections/config ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 9.29 KB
dist/bin/generateImportMap ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 9.08 KB
dist/config/orderable ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 8.73 KB
dist/uploads/fetchAPI-multipart ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 8.35 KB
dist/auth/strategies ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 7.60 KB
dist/index.js ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 7.57 KB
dist/database/migrations ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 7.55 KB
dist/auth/endpoints ${{\color{Goldenrod}{ }}}$ 0.4%, 6.59 KB
dist/config/sanitize.js ${{\color{Goldenrod}{ }}}$ 0.4%, 6.44 KB
(other) ${{\color{Goldenrod}{ ████████▎ }}}$ 33.3%, 491.67 KB

Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ███████████████████▊ }}}$ 79.1%, 157.26 KB
dist/fields/validations.js ${{\color{Goldenrod}{ █▎ }}}$ 5.3%, 10.61 KB
dist/utilities/deepCopyObject.js ${{\color{Goldenrod}{ ▍ }}}$ 1.7%, 3.35 KB
dist/config/orderable ${{\color{Goldenrod}{ ▍ }}}$ 1.6%, 3.13 KB
dist/fields/baseFields ${{\color{Goldenrod}{ ▎ }}}$ 1.4%, 2.79 KB
dist/auth/cookies.js ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 1.55 KB
dist/utilities/flattenTopLevelFields.js ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 1.42 KB
dist/fields/config ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 1.28 KB
dist/utilities/getVersionsConfig.js ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 1.04 KB
dist/utilities/flattenAllFields.js ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 943 B
dist/folders/utils ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 916 B
dist/utilities/unflatten.js ${{\color{Goldenrod}{ }}}$ 0.4%, 850 B
dist/utilities/sanitizeUserDataForEmail.js ${{\color{Goldenrod}{ }}}$ 0.4%, 713 B
dist/utilities/getFieldPermissions.js ${{\color{Goldenrod}{ }}}$ 0.3%, 651 B
dist/utilities/fieldPath.js ${{\color{Goldenrod}{ }}}$ 0.3%, 639 B
dist/utilities/getSafeRedirect.js ${{\color{Goldenrod}{ }}}$ 0.3%, 632 B
dist/uploads/getFileTypeIdentity.js ${{\color{Goldenrod}{ }}}$ 0.3%, 625 B
dist/collections/config ${{\color{Goldenrod}{ }}}$ 0.3%, 570 B
dist/bin/generateImportMap ${{\color{Goldenrod}{ }}}$ 0.3%, 561 B
dist/utilities/formatAdminURL.js ${{\color{Goldenrod}{ }}}$ 0.3%, 531 B
(other) ${{\color{Goldenrod}{ █████▏ }}}$ 20.9%, 41.61 KB

Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js

Path Size
dist/features/blocks ${{\color{Goldenrod}{ ███▏ }}}$ 12.7%, 36.44 KB
dist/lexical/plugins ${{\color{Goldenrod}{ ██▊ }}}$ 11.4%, 32.93 KB
dist/lexical/ui ${{\color{Goldenrod}{ ██▏ }}}$ 8.5%, 24.36 KB
dist/features/experimental_table ${{\color{Goldenrod}{ ██ }}}$ 8.2%, 23.66 KB
dist/packages/@lexical ${{\color{Goldenrod}{ █▋ }}}$ 6.9%, 19.80 KB
dist/features/link ${{\color{Goldenrod}{ █▋ }}}$ 6.5%, 18.62 KB
dist/features/toolbars ${{\color{Goldenrod}{ █▍ }}}$ 5.6%, 16.08 KB
dist/features/upload ${{\color{Goldenrod}{ █▏ }}}$ 4.8%, 13.92 KB
dist/features/textState ${{\color{Goldenrod}{ ▉ }}}$ 3.8%, 11.08 KB
dist/features/relationship ${{\color{Goldenrod}{ ▊ }}}$ 3.2%, 9.10 KB
dist/lexical/utils ${{\color{Goldenrod}{ ▊ }}}$ 3.1%, 8.79 KB
dist/features/converters ${{\color{Goldenrod}{ ▋ }}}$ 2.9%, 8.40 KB
dist/features/debug ${{\color{Goldenrod}{ ▋ }}}$ 2.6%, 7.40 KB
dist/utilities/fieldsDrawer ${{\color{Goldenrod}{ ▋ }}}$ 2.5%, 7.18 KB
dist/lexical/config ${{\color{Goldenrod}{ ▍ }}}$ 1.8%, 5.08 KB
dist/features/lists ${{\color{Goldenrod}{ ▍ }}}$ 1.7%, 5.03 KB
dist/features/format ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 3.46 KB
dist/lexical/LexicalEditor.js ${{\color{Goldenrod}{ ▎ }}}$ 1.1%, 3.23 KB
dist/field/Field.js ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 2.80 KB
dist/lexical/nodes ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 2.66 KB
(other) ${{\color{Goldenrod}{ █████████████████████▊ }}}$ 87.3%, 251.41 KB

Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ████████████▏ }}}$ 48.5%, 579.15 KB
dist/elements/FolderView ${{\color{Goldenrod}{ ▋ }}}$ 2.5%, 29.60 KB
dist/elements/BulkUpload ${{\color{Goldenrod}{ ▌ }}}$ 2.4%, 28.53 KB
dist/views/Edit ${{\color{Goldenrod}{ ▍ }}}$ 1.8%, 21.16 KB
dist/providers/Auth ${{\color{Goldenrod}{ ▍ }}}$ 1.5%, 17.62 KB
dist/elements/WhereBuilder ${{\color{Goldenrod}{ ▍ }}}$ 1.5%, 17.36 KB
dist/forms/Form ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 16.07 KB
dist/elements/Table ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 15.80 KB
dist/fields/Relationship ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 15.79 KB
dist/fields/Upload ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 14.25 KB
dist/fields/Blocks ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 13.90 KB
dist/elements/QueryPresets ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 10.38 KB
dist/elements/PublishButton ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 8.59 KB
dist/providers/Folders ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 8.46 KB
dist/elements/HTMLDiff ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 8.38 KB
dist/views/CollectionFolder ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 7.83 KB
dist/fields/Array ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 7.73 KB
dist/views/List ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 7.36 KB
dist/elements/ReactSelect ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 7.33 KB
dist/elements/ListHeader ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 7.12 KB
(other) ${{\color{Goldenrod}{ ████████████▉ }}}$ 51.5%, 615.48 KB

Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js

Path Size
dist/graphics/Logo ${{\color{Goldenrod}{ █████ }}}$ 20.0%, 3.12 KB
../../node_modules ${{\color{Goldenrod}{ ████▎ }}}$ 17.0%, 2.65 KB
dist/graphics/Icon ${{\color{Goldenrod}{ ██▍ }}}$ 9.8%, 1.52 KB
dist/utilities/formatDocTitle ${{\color{Goldenrod}{ ██▏ }}}$ 8.5%, 1.32 KB
dist/providers/TableColumns ${{\color{Goldenrod}{ █▍ }}}$ 5.5%, 862 B
dist/utilities/groupNavItems.js ${{\color{Goldenrod}{ █▎ }}}$ 5.2%, 814 B
dist/utilities/getGlobalData.js ${{\color{Goldenrod}{ █▏ }}}$ 4.9%, 762 B
dist/utilities/api.js ${{\color{Goldenrod}{ █▏ }}}$ 4.8%, 756 B
dist/elements/Translation ${{\color{Goldenrod}{ ▊ }}}$ 3.2%, 493 B
dist/utilities/handleTakeOver.js ${{\color{Goldenrod}{ ▋ }}}$ 2.8%, 440 B
dist/utilities/traverseForLocalizedFields.js ${{\color{Goldenrod}{ ▋ }}}$ 2.6%, 399 B
dist/elements/withMergedProps ${{\color{Goldenrod}{ ▌ }}}$ 2.2%, 339 B
dist/utilities/getVisibleEntities.js ${{\color{Goldenrod}{ ▌ }}}$ 2.1%, 329 B
dist/utilities/getNavGroups.js ${{\color{Goldenrod}{ ▍ }}}$ 1.9%, 301 B
dist/elements/WithServerSideProps ${{\color{Goldenrod}{ ▍ }}}$ 1.5%, 232 B
dist/utilities/handleGoBack.js ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 180 B
dist/fields/mergeFieldStyles.js ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 159 B
dist/utilities/handleBackToDashboard.js ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 152 B
dist/forms/Form ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 147 B
dist/utilities/abortAndIgnore.js ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 146 B
(other) ${{\color{Goldenrod}{ ████████████████████ }}}$ 80.0%, 12.51 KB
Details

Next to the size is how much the size has increased or decreased compared with the base branch of this PR.

  • ‼️: Size increased by 20% or more. Special attention should be given to this.
  • ⚠️: Size increased in acceptable range (lower than 20%).
  • ✅: No change or even downsized.
  • 🗑️: The out file is deleted: not found in base branch.
  • 🆕: The out file is newly found: will be added to base branch.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@denolfe denolfe mentioned this pull request Nov 3, 2026
ci: fix content api tests startup and auth #19304
Merged
nathanlentz
nathanlentz approved these changes Nov 3, 2026
View reviewed changes
@denolfe denolfe mentioned this pull request Nov 3, 2026
ci: automatically create dep update PRs that fix GHSA findings #19295
Merged
@denolfe
denolfe merged commit 59c52a7 into 3.x Nov 3, 2026
182 of 183 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@denolfe
denolfe deleted the ci/content-api-skip-bot-prs-3x branch November 3, 2026 21:06
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.93.0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

denolfe added a commit that referenced this pull request Nov 4, 2026
@denolfe
ci: fix content api tests startup and auth (#19304)
72396f4
Port of #19275 from `main` to `3.x`. Content API Tests fail on 3.x PRs
because the Content API server does not start.

On #19300, the server exits with "Failed to connect to Content API
rate-limit Valkey after 3 attempts". #19300 needs this port before its
Content API job can pass.

## Root Cause

The Content API image loads a bundled `.env.local` when
`NODE_ENV=development`. Two values in it do not match CI:

- `RATE_LIMIT_VALKEY_URL` points to `localhost:16379`. The server needs
this connection to start. CI has no Valkey (a Redis-compatible key-value
store), so the server exits before it listens.
- `JWKS_URI` (the URL where the server fetches its token-verification
keys) points to port 18088. CI serves the API on 8080. The key fetch
fails, and the server rejects the tokens it issued from `/dev/jwt`.

## Changes

- **Port of #19275**
- Cherry-picked from `main` with no conflicts. Only
`.github/workflows/main.yml` changes.
- **Valkey service container**
- Adds `valkey/valkey:8` on port 6379 with a `valkey-cli ping` health
check.
- **Explicit Content API env**
- CI sets `JWKS_URI`, `RATE_LIMIT_VALKEY_URL`, and `VALKEY_URL` on
`docker run`.
- Node's `loadEnvFile` does not override variables that are already set.
The image defaults cannot change these values.

🤖 Written with AI
denolfe added a commit that referenced this pull request Nov 4, 2026
@denolfe
ci: automatically create dep update PRs that fix GHSA findings (#19295)
487fa2d
The daily dependency audit now opens PRs that fix the advisories it
finds, on `main` and `3.x`. One PR holds all non-major bumps, and each
major bump gets its own draft PR.

Merge after #19300, which skips bot PRs in the `3.x` content API tests.

```diff
 .github/
 ├── actions/
 │   ├── audit-dependencies/src/lib/bumpAdvisor.ts  # traces the whole graph when a module leaves its chain
 │   └── setup/action.yml               # pins setup-node to a commit SHA
 ├── scripts/
+│   └── audit-deps/                    # plans bumps, prepares commits, renders PR bodies
+│       ├── cli.mjs                    # plan, prepare-prs
+│       ├── plan.mjs                   # builds and checks the bump and PR plan
+│       ├── step-handoff.mjs           # checks the data each step gives the next
+│       └── commands/                  # github-script steps: decide PR steps, publish
 └── workflows/
     ├── audit-dependencies.yml         # calls the branch workflow once per ref
+    ├── audit-dependencies-branch.yml  # one job: audit, plan, prepare, publish
     └── main.yml                       # runs audit-deps specs, skips bot PRs in content API tests
```

The audit action already reports which direct dependency bump clears
each advisory. Until now a person had to apply that bump by hand. This
PR applies the plan in CI, takes over from Dependabot security PRs, and
supersedes #19217, which had Codex write the fix.

Resolves PYLD-5012

**Example dry run:** [run
41712179405](https://github.com/payloadcms/payload/actions/runs/41712179405)
audits `main` and `3.x`. The run summary lists the PRs it would open.

**Example PR Body**

<img width="1040" height="900" alt="image"
src="https://github.com/user-attachments/assets/ec21a4de-9112-4187-a71f-b710adcc50c8"
/>

## Changes

- **Branch workflow** (`audit-dependencies-branch.yml`)
  - One job per ref audits, plans, prepares and publishes.
- Only the publish step holds a write token. It is a GitHub App token,
minted after prepare.
- The scripts and the audit action come from the tooling checkout (a
sparse clone of the triggering commit). The audited ref gives only its
tree and its allowlist.
- A dry run from a branch therefore tests that branch's audit action
too.
- Publish runs only when prepare finishes. It still runs when the App
token mint fails, so the summary can report the missing token.
- **Pinned actions**
- Every action the job runs, including those in the shared setup action,
is pinned to a full commit SHA.
- The `setup-node` pin in the setup action applies to every workflow
that uses it. It pins the commit `@v6` resolves to today.
- **Plan and prepare** (`.github/scripts/audit-deps`)
- `plan` groups the fixable bumps: non-major bumps in one PR, each major
in its own draft PR.
  - `prepare-prs` makes each PR one bot commit on the audited commit.
- Bumps use `pnpm install --lockfile-only --ignore-scripts`. No package
install scripts run.
- A range specifier such as `>=5.0.0` is left unchanged. The re-audit
shows whether the other edits fix the advisory.
- A path guard rejects any change outside the bumped manifests and the
lockfile.
- A re-audit runs on each prepared commit. A PR fails if an advisory it
claims is still reported.
- **Step handoffs**
- One plan module builds and reads the plan. Every step that reads it
checks that each PR names known bumps.
- The handoff module checks `pr_steps` and `prepared.json` (the data one
step gives the next) when it writes them and when it reads them.
- A bad handoff stops the run before any push. An update without a PR
number is one example.
- `prepare-prs` records every planned PR, including skipped and blocked
ones. Publish reads only that file.
- **Existing PRs**
- Each PR body ends with a fingerprint (a hidden comment with the PR id,
bumps and advisories).
- An unchanged PR is skipped. A PR with a person's commits is not
updated.
  - A PR a person closed is not opened again for the same change.
  - Bot PRs that are no longer planned are closed.
- When GitHub has not yet computed whether a PR has conflicts, publish
asks again, up to three times.
- **PR body**
- Lists each bump with its advisories, upstream release notes and
commits.
- An advisory counts as fixed only when none of its findings still
reaches a bumped dependency.
- Each bump lists as affected only the packages that declare its
dependency.
  - Major PRs start with a review banner.
- Upstream details load one bump at a time. This keeps a large group PR
under GitHub's secondary rate limit.
- A repository owner or name from the registry must be a plain path
segment. Other values give no upstream links.
- Outside text is sanitized. Issue references, mentions and HTML
comments cannot break the body or notify anyone.
- Upstream GitHub links go through `redirect.github.com`. A link to an
issue cannot add a reference event to it.
- **Bump advisor** (`bumpAdvisor.ts`)
- The advisor first traces only the advisory's chain (the packages
between the direct dependency and the vulnerable module).
- When that trace finds no copy of the module, the advisor now traces
the whole graph before it reports `clear`.
- A renamed package no longer gives a false fix. `@sentry/nextjs`
10.76.2 renames `@sentry/bundler-plugin-core` to
`@sentry/bundler-plugins`. The new package still pulls `glob` 13.
- The `glob` and `minimatch` advisories through Sentry now show as "no
fix available". Sentry merged the `glob` 14 fix but has not released it.
- When a release clears them, the planner opens the Sentry PR. No
allowlist entry is needed.
- **`audit-dependencies.yml`**
- Real runs audit at `moderate` severity. At `high`, `main` had no
findings.
- **`main.yml`**
  - audit-deps specs run in CI.
- Content API tests skip bot PRs. That job assumes an AWS role. Bot PRs
run dependency versions no person has reviewed.
- **Dry runs**
  - Runs from other branches, or with non-default inputs, only report.
- A dispatch for one ref is a dry run. A real manual run needs `ref:
both` from `main`.
- Real runs share one concurrency group (a queue that keeps only its
newest pending run). Each dry run gets its own group.
  - A dry run therefore cannot replace a pending real run.

## Design Decisions

- **No AI in the fix.** pnpm applies the bump the audit planned. The PR
body is built from registry and GitHub data. #19217 had Codex write the
change; this PR drops that.
- **Token per step.** Steps that run pnpm or read registry data hold the
read-only `github.token` at most. The App token exists only in the
publish step.
- **Lease on push.** Publish pushes with `--force-with-lease` (a push
that fails if the remote branch moved since the plan read it). A
person's push is never overwritten.
- **No cache.** The job later holds a write token. It restores no cache
another workflow could have written.
- **Re-audit stays strict.** The advisor's trace is a guess that bounds
registry requests. The re-audit is the check. A PR that still reports a
claimed advisory fails instead of opening.
- **Accepted costs**
  - A PR fails when the re-audit disagrees with the plan.
  - A failed group PR is not retried per bump.
  - Major PRs are drafts. A person reads the release notes before merge.
  - A closed group PR stays closed only for the exact same set of bumps.
- `main`'s audit action audits the `3.x` tree. A later action change on
`main` must also work on `3.x`.
- Each prepared PR runs a full re-audit. The job time grows with the
number of PRs.
- PRs that touch only `.github/scripts/audit-deps` run the full test
suite. The unit test job depends on the build job.
- The `audit-deps` environment allows the feature branch and has no
required reviewers. Using it from that branch needs write access. The
branch leaves the policy after merge.
- A consumer package whose dependencies fail to resolve gives no
findings. The re-audit then counts its advisories as fixed, and a
planned PR can close as stale. That audit behavior is already on `main`.

## Overall Flow

```diff
 audit-dependencies.yml (daily schedule or dispatch; refs main and 3.x)
-  audit action          -> report
+  audit-dependencies-branch.yml, once per ref
+    checkout tooling    -> scripts and audit action from the triggering commit
+    audit action        -> report on the audited ref's tree
+    plan                -> bumps grouped into PRs
+    decide PR steps     -> create, update, skip, skip-rejected or blocked; stale PRs
+    prepare-prs         -> per PR: bump, lockfile, path guard, re-audit, commit
+    mint App token      (real runs only)
+    publish             (only when prepare-prs finishes)
+                        -> push with lease, create or update PR, close stale PRs, summary
```

## References / Links

-
[actions/create-github-app-token](https://github.com/actions/create-github-app-token):
App token for the publish step
- [git push](https://git-scm.com/docs/git-push): `--force-with-lease`
semantics
- [pnpm install](https://pnpm.io/cli/install): `--lockfile-only` and
`--ignore-scripts`
-
[getsentry/sentry-javascript#25969](getsentry/sentry-javascript#25969):
`glob` and `minimatch` advisories in `@sentry/bundler-plugins`
-
[getsentry/sentry-javascript#26014](getsentry/sentry-javascript#26014):
Sentry fix that moves `glob` to 14, not yet released

🤖 Written with AI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nathanlentz nathanlentz nathanlentz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

created-by: Payload team v3

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@denolfe @nathanlentz
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.