Automate Dependabot vendor refreshes - #80
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50504a1ce5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| set -euo pipefail | ||
| git fetch --no-tags origin "refs/heads/${HEAD_REF}" | ||
| test "$(git rev-parse FETCH_HEAD)" = "$HEAD_SHA" | ||
| git checkout --detach FETCH_HEAD |
There was a problem hiding this comment.
Clean the generated manifests before checking out the PR
For every npm update where package.json or package-lock.json differs from the default branch, the earlier fetch step overwrites those tracked files in the current checkout, so this unforced checkout aborts with Your local changes ... would be overwritten by checkout even though the working-tree contents match FETCH_HEAD; consequently the workflow never reaches the vendor commit. As confirmed by git checkout -h, --force is the option that will “throw away local modifications,” so reset/clean the generation checkout or perform the PR checkout in a separate clean worktree.
Useful? React with 👍 / 👎.
What changed
workflow_runthat refreshes committed frontend vendor assets only for validated npm Dependabot PRs whose existing vendor check failedstatic/vendor/**, then dispatch the normal test workflow for the exact generated commit SHAWhy
Dependabot can update
package.jsonandpackage-lock.json, but it cannot regenerate the frontend files committed understatic/vendor/. The existingvendor:checkcorrectly rejects those stale assets, leaving otherwise valid npm update PRs red.The follow-up workflow keeps the write token separate from untrusted PR execution and gives Dependabot PRs a deterministic path back to the normal test suite.
Validation
pytest tests -q- 1326 passed, 33 skippednpm run test:js- 73 passednpm run vendor:check- 10 assets verifiedgit diff --check