Skip to content

Commit 6e9e292

Browse files
committed
feat: update root package-lock after workspace releases
1 parent afe6fb1 commit 6e9e292

File tree

2 files changed

+71
-2
lines changed

2 files changed

+71
-2
lines changed

lib/content/release-please.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
- {{.}}
1212
{{/each}}
1313

14+
{{~#if isWorkspace}}
15+
permissions:
16+
contents: write
17+
{{/if}}
18+
1419
jobs:
1520
release-please:
1621
runs-on: ubuntu-latest
@@ -29,3 +34,19 @@ jobs:
2934
{{{json .}}}{{#unless @last}},{{/unless}}
3035
{{/each}}
3136
]
37+
{{~#if isWorkspace}}
38+
{{> setupGit}}
39+
{{> setupNode}}
40+
- name: Update package-lock.json and commit
41+
if: steps.release.outputs.pr
42+
env:
43+
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
44+
run: |
45+
gh pr checkout $\{{ fromJSON(steps.release.outputs.pr).number }}
46+
npm run resetdeps
47+
title="$\{{ fromJSON(steps.release.outputs.pr).title }}"
48+
# get the version from the pr title
49+
# get everything after the last space
50+
git commit -am "deps: {{pkgName}}@${title##* }"
51+
git push
52+
{{/if}}

tap-snapshots/test/apply/full-content.js.test.cjs

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,8 @@ on:
10581058
branches:
10591059
- main
10601060
- latest
1061+
permissions:
1062+
contents: write
10611063
10621064
jobs:
10631065
release-please:
@@ -1076,7 +1078,29 @@ jobs:
10761078
{"type":"docs","section":"Documentation","hidden":false},
10771079
{"type":"deps","section":"Dependencies","hidden":false},
10781080
{"type":"chore","hidden":true}
1079-
]
1081+
] - uses: actions/checkout@v3
1082+
- name: Setup git user
1083+
run: |
1084+
git config --global user.email "[email protected]"
1085+
git config --global user.name "npm cli ops bot"
1086+
- uses: actions/setup-node@v3
1087+
with:
1088+
node-version: 16.x
1089+
- name: Update npm to latest
1090+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
1091+
- run: npm -v
1092+
- name: Update package-lock.json and commit
1093+
if: steps.release.outputs.pr
1094+
env:
1095+
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
1096+
run: |
1097+
gh pr checkout \${{ fromJSON(steps.release.outputs.pr).number }}
1098+
npm run resetdeps
1099+
title="\${{ fromJSON(steps.release.outputs.pr).title }}"
1100+
# get the version from the pr title
1101+
# get everything after the last space
1102+
git commit -am "deps: bbb@\${title##* }"
1103+
git push
10801104
10811105
.github/workflows/release-please-name-aaaa.yml
10821106
========================================
@@ -1091,6 +1115,8 @@ on:
10911115
branches:
10921116
- main
10931117
- latest
1118+
permissions:
1119+
contents: write
10941120
10951121
jobs:
10961122
release-please:
@@ -1109,7 +1135,29 @@ jobs:
11091135
{"type":"docs","section":"Documentation","hidden":false},
11101136
{"type":"deps","section":"Dependencies","hidden":false},
11111137
{"type":"chore","hidden":true}
1112-
]
1138+
] - uses: actions/checkout@v3
1139+
- name: Setup git user
1140+
run: |
1141+
git config --global user.email "[email protected]"
1142+
git config --global user.name "npm cli ops bot"
1143+
- uses: actions/setup-node@v3
1144+
with:
1145+
node-version: 16.x
1146+
- name: Update npm to latest
1147+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
1148+
- run: npm -v
1149+
- name: Update package-lock.json and commit
1150+
if: steps.release.outputs.pr
1151+
env:
1152+
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
1153+
run: |
1154+
gh pr checkout \${{ fromJSON(steps.release.outputs.pr).number }}
1155+
npm run resetdeps
1156+
title="\${{ fromJSON(steps.release.outputs.pr).title }}"
1157+
# get the version from the pr title
1158+
# get everything after the last space
1159+
git commit -am "deps: @name/aaaa@\${title##* }"
1160+
git push
11131161
11141162
.github/workflows/release-please.yml
11151163
========================================

0 commit comments

Comments
 (0)