Skip to content

Commit

Permalink
feat: update root package-lock after workspace releases (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys authored Apr 6, 2022
1 parent f6aa844 commit bd3da0e
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 2 deletions.
21 changes: 21 additions & 0 deletions lib/content/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
- {{.}}
{{/each}}

{{~#if isWorkspace}}
permissions:
contents: write
{{/if}}

jobs:
release-please:
runs-on: ubuntu-latest
Expand All @@ -32,3 +37,19 @@ jobs:
{{{json .}}}{{#unless @last}},{{/unless}}
{{/each}}
]
{{~#if isWorkspace}}
{{> setupGit}}
{{> setupNode}}
- name: Update package-lock.json and commit
if: steps.release.outputs.pr
env:
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout $\{{ fromJSON(steps.release.outputs.pr).number }}
npm run resetdeps
title="$\{{ fromJSON(steps.release.outputs.pr).title }}"
# get the version from the pr title
# get everything after the last space
git commit -am "deps: {{pkgName}}@${title##* }"
git push
{{/if}}
52 changes: 50 additions & 2 deletions tap-snapshots/test/apply/full-content.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,8 @@ on:
branches:
- main
- latest
permissions:
contents: write
jobs:
release-please:
Expand All @@ -1077,7 +1079,29 @@ jobs:
{"type":"docs","section":"Documentation","hidden":false},
{"type":"deps","section":"Dependencies","hidden":false},
{"type":"chore","hidden":true}
]
] - uses: actions/checkout@v3
- name: Setup git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm cli ops bot"
- uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Update npm to latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- name: Update package-lock.json and commit
if: steps.release.outputs.pr
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout \${{ fromJSON(steps.release.outputs.pr).number }}
npm run resetdeps
title="\${{ fromJSON(steps.release.outputs.pr).title }}"
# get the version from the pr title
# get everything after the last space
git commit -am "deps: bbb@\${title##* }"
git push
.github/workflows/release-please-name-aaaa.yml
========================================
Expand All @@ -1092,6 +1116,8 @@ on:
branches:
- main
- latest
permissions:
contents: write
jobs:
release-please:
Expand All @@ -1113,7 +1139,29 @@ jobs:
{"type":"docs","section":"Documentation","hidden":false},
{"type":"deps","section":"Dependencies","hidden":false},
{"type":"chore","hidden":true}
]
] - uses: actions/checkout@v3
- name: Setup git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm cli ops bot"
- uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Update npm to latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- name: Update package-lock.json and commit
if: steps.release.outputs.pr
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout \${{ fromJSON(steps.release.outputs.pr).number }}
npm run resetdeps
title="\${{ fromJSON(steps.release.outputs.pr).title }}"
# get the version from the pr title
# get everything after the last space
git commit -am "deps: @name/aaaa@\${title##* }"
git push
.github/workflows/release-please.yml
========================================
Expand Down

0 comments on commit bd3da0e

Please sign in to comment.