Skip to content

Commit 5e2c5e4

Browse files
committed
Recreate Generate lockfile workflow, PR-based this time.
The prior version (removed in PR #10) pushed the regenerated lockfile straight to main via GITHUB_TOKEN, which doesn't trigger other workflows -- so its own commits never got the required "test" check and were likely to be blocked by the branch ruleset. This version opens a PR instead (via peter-evans/create-pull-request), so normal push/pull_request CI runs on it like any other change. See Notion: madmcp-delegate-gemini-resume-fix-plan page's sibling context and PR #10 for background.
1 parent f1a2adc commit 5e2c5e4

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Generate lockfile
2+
3+
# Manual, on-demand regeneration of package-lock.json.
4+
#
5+
# History: an earlier version of this workflow (removed in PR #10) pushed
6+
# the regenerated lockfile straight to main using the built-in GITHUB_TOKEN.
7+
# That's broken by design: GITHUB_TOKEN-authored pushes do NOT trigger other
8+
# workflow runs (a deliberate GitHub Actions anti-recursion safeguard), so
9+
# the branch ruleset's required "test" check never ran on those commits --
10+
# meaning the bot's own pushes were likely to get blocked by the very
11+
# ruleset meant to protect main. This version avoids that by opening a PR
12+
# instead of pushing directly: a PR created by GITHUB_TOKEN DOES trigger the
13+
# normal push/pull_request CI workflow on its branch, so the required check
14+
# runs like it would for any human-authored change, and the PR merges (or
15+
# not) through the normal ruleset-gated path.
16+
on:
17+
workflow_dispatch: {}
18+
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
23+
jobs:
24+
generate-lockfile:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: "20"
32+
33+
- name: Regenerate package-lock.json
34+
run: |
35+
set -e
36+
rm -f package-lock.json
37+
npm install
38+
39+
- name: Open PR with the regenerated lockfile
40+
uses: peter-evans/create-pull-request@v6
41+
with:
42+
token: ${{ secrets.GITHUB_TOKEN }}
43+
commit-message: "chore: regenerate package-lock.json"
44+
branch: chore/regenerate-lockfile
45+
delete-branch: true
46+
title: "chore: regenerate package-lock.json"
47+
body: |
48+
Automated lockfile regeneration, triggered manually via the "Generate lockfile" workflow.
49+
50+
Opened as a PR (not pushed directly to main) so the required CI check runs on these commits before they merge -- see the workflow file's header comment for why the old push-to-main version couldn't do that.
51+
labels: dependencies

0 commit comments

Comments
 (0)