From c8dd00f6bdc0de6aea4b21037e78bba1571f1134 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Thu, 23 Jul 2026 09:42:38 +0530 Subject: [PATCH 1/4] add workflow --- .github/workflows/update-dependents.yml | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/update-dependents.yml diff --git a/.github/workflows/update-dependents.yml b/.github/workflows/update-dependents.yml new file mode 100644 index 0000000..5bd8c50 --- /dev/null +++ b/.github/workflows/update-dependents.yml @@ -0,0 +1,68 @@ +name: Update Dependent Repos + +on: + release: + types: published + workflow_dispatch: + inputs: + version: + description: "Release version to update dependents" + required: true + +jobs: + update-dependents: + name: Update ${{ matrix.repo }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + repo: + - matlab-actions/run-command + - matlab-actions/run-tests + - matlab-actions/run-build + steps: + - name: Checkout dependent repo + uses: actions/checkout@v6 + with: + repository: ${{ matrix.repo }} + token: ${{ secrets.REPOS_ACCESS_TOKEN }} + + - uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: Update common-utils dependency + run: | + NEW_VERSION="${{ github.event.release.tag_name || inputs.version }}" + + # Update the dependency reference in package.json + sed -i "s|\"common-utils\": \"github:matlab-actions/common-utils#.*\"|\"common-utils\": \"github:matlab-actions/common-utils#${NEW_VERSION}\"|" package.json + + # Regenerate package-lock.json with the new version + npm install --package-lock-only + + - name: Commit and push changes + run: | + VERSION="${{ github.event.release.tag_name || inputs.version }}" + BRANCH="update-common-utils-${VERSION}" + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b "${BRANCH}" + git add package.json package-lock.json + git commit -m "Bump common-utils to ${VERSION}" + git push origin "${BRANCH}" + + - name: Create pull request + env: + GH_TOKEN: ${{ secrets.REPOS_ACCESS_TOKEN }} + run: | + VERSION="${{ github.event.release.tag_name || inputs.version }}" + BRANCH="update-common-utils-${VERSION}" + + gh pr create \ + --repo ${{ matrix.repo }} \ + --base main \ + --head "${BRANCH}" \ + --title "Bump common-utils to ${VERSION}" \ + --body "Automated PR to update \`common-utils\` dependency to [${VERSION}](https://github.com/matlab-actions/common-utils/releases/tag/${VERSION})." From 907f3e276cd1677ff6d3efa9aa74d383869aa916 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Thu, 23 Jul 2026 09:57:39 +0530 Subject: [PATCH 2/4] set permissions --- .github/workflows/update-dependents.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/update-dependents.yml b/.github/workflows/update-dependents.yml index 5bd8c50..4e8e1cf 100644 --- a/.github/workflows/update-dependents.yml +++ b/.github/workflows/update-dependents.yml @@ -9,6 +9,9 @@ on: description: "Release version to update dependents" required: true +permissions: + contents: read + jobs: update-dependents: name: Update ${{ matrix.repo }} From 786e4b3a64c67abc938cad2cd49ec9cc5aafd976 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Thu, 23 Jul 2026 09:59:49 +0530 Subject: [PATCH 3/4] fix formatting --- .github/workflows/update-dependents.yml | 142 ++++++++++++------------ 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/.github/workflows/update-dependents.yml b/.github/workflows/update-dependents.yml index 4e8e1cf..e5cddb9 100644 --- a/.github/workflows/update-dependents.yml +++ b/.github/workflows/update-dependents.yml @@ -1,71 +1,71 @@ -name: Update Dependent Repos - -on: - release: - types: published - workflow_dispatch: - inputs: - version: - description: "Release version to update dependents" - required: true - -permissions: - contents: read - -jobs: - update-dependents: - name: Update ${{ matrix.repo }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - repo: - - matlab-actions/run-command - - matlab-actions/run-tests - - matlab-actions/run-build - steps: - - name: Checkout dependent repo - uses: actions/checkout@v6 - with: - repository: ${{ matrix.repo }} - token: ${{ secrets.REPOS_ACCESS_TOKEN }} - - - uses: actions/setup-node@v6 - with: - node-version: 24 - - - name: Update common-utils dependency - run: | - NEW_VERSION="${{ github.event.release.tag_name || inputs.version }}" - - # Update the dependency reference in package.json - sed -i "s|\"common-utils\": \"github:matlab-actions/common-utils#.*\"|\"common-utils\": \"github:matlab-actions/common-utils#${NEW_VERSION}\"|" package.json - - # Regenerate package-lock.json with the new version - npm install --package-lock-only - - - name: Commit and push changes - run: | - VERSION="${{ github.event.release.tag_name || inputs.version }}" - BRANCH="update-common-utils-${VERSION}" - - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git checkout -b "${BRANCH}" - git add package.json package-lock.json - git commit -m "Bump common-utils to ${VERSION}" - git push origin "${BRANCH}" - - - name: Create pull request - env: - GH_TOKEN: ${{ secrets.REPOS_ACCESS_TOKEN }} - run: | - VERSION="${{ github.event.release.tag_name || inputs.version }}" - BRANCH="update-common-utils-${VERSION}" - - gh pr create \ - --repo ${{ matrix.repo }} \ - --base main \ - --head "${BRANCH}" \ - --title "Bump common-utils to ${VERSION}" \ - --body "Automated PR to update \`common-utils\` dependency to [${VERSION}](https://github.com/matlab-actions/common-utils/releases/tag/${VERSION})." +name: Update Dependent Repos + +on: + release: + types: published + workflow_dispatch: + inputs: + version: + description: "Release version to update dependents" + required: true + +permissions: + contents: read + +jobs: + update-dependents: + name: Update ${{ matrix.repo }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + repo: + - matlab-actions/run-command + - matlab-actions/run-tests + - matlab-actions/run-build + steps: + - name: Checkout dependent repo + uses: actions/checkout@v6 + with: + repository: ${{ matrix.repo }} + token: ${{ secrets.REPOS_ACCESS_TOKEN }} + + - uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: Update common-utils dependency + run: | + NEW_VERSION="${{ github.event.release.tag_name || inputs.version }}" + + # Update the dependency reference in package.json + sed -i "s|\"common-utils\": \"github:matlab-actions/common-utils#.*\"|\"common-utils\": \"github:matlab-actions/common-utils#${NEW_VERSION}\"|" package.json + + # Regenerate package-lock.json with the new version + npm install --package-lock-only + + - name: Commit and push changes + run: | + VERSION="${{ github.event.release.tag_name || inputs.version }}" + BRANCH="update-common-utils-${VERSION}" + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b "${BRANCH}" + git add package.json package-lock.json + git commit -m "Bump common-utils to ${VERSION}" + git push origin "${BRANCH}" + + - name: Create pull request + env: + GH_TOKEN: ${{ secrets.REPOS_ACCESS_TOKEN }} + run: | + VERSION="${{ github.event.release.tag_name || inputs.version }}" + BRANCH="update-common-utils-${VERSION}" + + gh pr create \ + --repo ${{ matrix.repo }} \ + --base main \ + --head "${BRANCH}" \ + --title "Bump common-utils to ${VERSION}" \ + --body "Automated PR to update \`common-utils\` dependency to [${VERSION}](https://github.com/matlab-actions/common-utils/releases/tag/${VERSION})." From 4cf80fcc2de99c433df41f7cc4d5863d252b8ddf Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Tue, 4 Aug 2026 10:18:51 +0530 Subject: [PATCH 4/4] update action versions --- .github/workflows/update-dependents.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-dependents.yml b/.github/workflows/update-dependents.yml index e5cddb9..426ee9b 100644 --- a/.github/workflows/update-dependents.yml +++ b/.github/workflows/update-dependents.yml @@ -25,12 +25,12 @@ jobs: - matlab-actions/run-build steps: - name: Checkout dependent repo - uses: actions/checkout@v6 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: ${{ matrix.repo }} token: ${{ secrets.REPOS_ACCESS_TOKEN }} - - uses: actions/setup-node@v6 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24