|
1 | | -name: Update Dependent Repos |
2 | | - |
3 | | -on: |
4 | | - release: |
5 | | - types: published |
6 | | - workflow_dispatch: |
7 | | - inputs: |
8 | | - version: |
9 | | - description: "Release version to update dependents" |
10 | | - required: true |
11 | | - |
12 | | -permissions: |
13 | | - contents: read |
14 | | - |
15 | | -jobs: |
16 | | - update-dependents: |
17 | | - name: Update ${{ matrix.repo }} |
18 | | - runs-on: ubuntu-latest |
19 | | - strategy: |
20 | | - fail-fast: false |
21 | | - matrix: |
22 | | - repo: |
23 | | - - matlab-actions/run-command |
24 | | - - matlab-actions/run-tests |
25 | | - - matlab-actions/run-build |
26 | | - steps: |
27 | | - - name: Checkout dependent repo |
28 | | - uses: actions/checkout@v6 |
29 | | - with: |
30 | | - repository: ${{ matrix.repo }} |
31 | | - token: ${{ secrets.REPOS_ACCESS_TOKEN }} |
32 | | - |
33 | | - - uses: actions/setup-node@v6 |
34 | | - with: |
35 | | - node-version: 24 |
36 | | - |
37 | | - - name: Update common-utils dependency |
38 | | - run: | |
39 | | - NEW_VERSION="${{ github.event.release.tag_name || inputs.version }}" |
40 | | -
|
41 | | - # Update the dependency reference in package.json |
42 | | - sed -i "s|\"common-utils\": \"github:matlab-actions/common-utils#.*\"|\"common-utils\": \"github:matlab-actions/common-utils#${NEW_VERSION}\"|" package.json |
43 | | -
|
44 | | - # Regenerate package-lock.json with the new version |
45 | | - npm install --package-lock-only |
46 | | -
|
47 | | - - name: Commit and push changes |
48 | | - run: | |
49 | | - VERSION="${{ github.event.release.tag_name || inputs.version }}" |
50 | | - BRANCH="update-common-utils-${VERSION}" |
51 | | -
|
52 | | - git config user.name "github-actions[bot]" |
53 | | - git config user.email "github-actions[bot]@users.noreply.github.com" |
54 | | - git checkout -b "${BRANCH}" |
55 | | - git add package.json package-lock.json |
56 | | - git commit -m "Bump common-utils to ${VERSION}" |
57 | | - git push origin "${BRANCH}" |
58 | | -
|
59 | | - - name: Create pull request |
60 | | - env: |
61 | | - GH_TOKEN: ${{ secrets.REPOS_ACCESS_TOKEN }} |
62 | | - run: | |
63 | | - VERSION="${{ github.event.release.tag_name || inputs.version }}" |
64 | | - BRANCH="update-common-utils-${VERSION}" |
65 | | -
|
66 | | - gh pr create \ |
67 | | - --repo ${{ matrix.repo }} \ |
68 | | - --base main \ |
69 | | - --head "${BRANCH}" \ |
70 | | - --title "Bump common-utils to ${VERSION}" \ |
71 | | - --body "Automated PR to update \`common-utils\` dependency to [${VERSION}](https://github.com/matlab-actions/common-utils/releases/tag/${VERSION})." |
| 1 | +name: Update Dependent Repos |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: published |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + version: |
| 9 | + description: "Release version to update dependents" |
| 10 | + required: true |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +jobs: |
| 16 | + update-dependents: |
| 17 | + name: Update ${{ matrix.repo }} |
| 18 | + runs-on: ubuntu-latest |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + repo: |
| 23 | + - matlab-actions/run-command |
| 24 | + - matlab-actions/run-tests |
| 25 | + - matlab-actions/run-build |
| 26 | + steps: |
| 27 | + - name: Checkout dependent repo |
| 28 | + uses: actions/checkout@v6 |
| 29 | + with: |
| 30 | + repository: ${{ matrix.repo }} |
| 31 | + token: ${{ secrets.REPOS_ACCESS_TOKEN }} |
| 32 | + |
| 33 | + - uses: actions/setup-node@v6 |
| 34 | + with: |
| 35 | + node-version: 24 |
| 36 | + |
| 37 | + - name: Update common-utils dependency |
| 38 | + run: | |
| 39 | + NEW_VERSION="${{ github.event.release.tag_name || inputs.version }}" |
| 40 | +
|
| 41 | + # Update the dependency reference in package.json |
| 42 | + sed -i "s|\"common-utils\": \"github:matlab-actions/common-utils#.*\"|\"common-utils\": \"github:matlab-actions/common-utils#${NEW_VERSION}\"|" package.json |
| 43 | +
|
| 44 | + # Regenerate package-lock.json with the new version |
| 45 | + npm install --package-lock-only |
| 46 | +
|
| 47 | + - name: Commit and push changes |
| 48 | + run: | |
| 49 | + VERSION="${{ github.event.release.tag_name || inputs.version }}" |
| 50 | + BRANCH="update-common-utils-${VERSION}" |
| 51 | +
|
| 52 | + git config user.name "github-actions[bot]" |
| 53 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 54 | + git checkout -b "${BRANCH}" |
| 55 | + git add package.json package-lock.json |
| 56 | + git commit -m "Bump common-utils to ${VERSION}" |
| 57 | + git push origin "${BRANCH}" |
| 58 | +
|
| 59 | + - name: Create pull request |
| 60 | + env: |
| 61 | + GH_TOKEN: ${{ secrets.REPOS_ACCESS_TOKEN }} |
| 62 | + run: | |
| 63 | + VERSION="${{ github.event.release.tag_name || inputs.version }}" |
| 64 | + BRANCH="update-common-utils-${VERSION}" |
| 65 | +
|
| 66 | + gh pr create \ |
| 67 | + --repo ${{ matrix.repo }} \ |
| 68 | + --base main \ |
| 69 | + --head "${BRANCH}" \ |
| 70 | + --title "Bump common-utils to ${VERSION}" \ |
| 71 | + --body "Automated PR to update \`common-utils\` dependency to [${VERSION}](https://github.com/matlab-actions/common-utils/releases/tag/${VERSION})." |
0 commit comments