|
8 | 8 | - main
|
9 | 9 | - latest
|
10 | 10 |
|
| 11 | +permissions: |
| 12 | + contents: write |
| 13 | + pull-requests: write |
| 14 | + |
11 | 15 | jobs:
|
12 | 16 | release-please:
|
13 | 17 | runs-on: ubuntu-latest
|
| 18 | + outputs: |
| 19 | + prs: ${{ steps.release.outputs.prs }} |
14 | 20 | steps:
|
15 | 21 | - uses: google-github-actions/release-please-action@v3
|
16 | 22 | id: release
|
17 | 23 | with:
|
18 |
| - release-type: node |
19 |
| - changelog-types: > |
20 |
| - [ |
21 |
| - {"type":"feat","section":"Features","hidden":false}, |
22 |
| - {"type":"fix","section":"Bug Fixes","hidden":false}, |
23 |
| - {"type":"docs","section":"Documentation","hidden":false}, |
24 |
| - {"type":"deps","section":"Dependencies","hidden":false}, |
25 |
| - {"type":"chore","hidden":true} |
26 |
| - ] |
| 24 | + command: manifest |
| 25 | + |
| 26 | + update-prs: |
| 27 | + needs: release-please |
| 28 | + if: needs.release-please.outputs.prs |
| 29 | + runs-on: ubuntu-latest |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + pr: ${{ fromJSON(needs.release-please.outputs.prs) }} |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + - name: Setup git user |
| 36 | + run: | |
| 37 | + git config --global user.email "[email protected]" |
| 38 | + git config --global user.name "npm CLI robot" |
| 39 | + - uses: actions/setup-node@v3 |
| 40 | + with: |
| 41 | + node-version: 16.x |
| 42 | + - name: Update npm to latest |
| 43 | + run: npm i --prefer-online --no-fund --no-audit -g npm@latest |
| 44 | + - run: npm -v |
| 45 | + - name: Update PR ${{ matrix.pr.number }} dependencies and commit |
| 46 | + if: steps.release.outputs.pr |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + run: | |
| 50 | + gh pr checkout ${{ matrix.pr.number }} |
| 51 | + npm run resetdeps |
| 52 | + title="${{ matrix.pr.title }}" |
| 53 | + # get the dependency spec from the pr title |
| 54 | + # get everything after ': release ' + replace space with @ |
| 55 | + dep_spec=$(echo "${title##*: release }" | tr ' ' @) |
| 56 | + git commit -am "deps: $dep_spec" |
| 57 | + git push |
0 commit comments