Skip to content

Add workflow to auto-update dependent repos on release - #34

Open
mw-kapilg wants to merge 5 commits into
mainfrom
kapilg/bump-dependents-workflow
Open

Add workflow to auto-update dependent repos on release#34
mw-kapilg wants to merge 5 commits into
mainfrom
kapilg/bump-dependents-workflow

Conversation

@mw-kapilg

Copy link
Copy Markdown
Contributor

Summary

  • Adds a GitHub Actions workflow that automatically opens PRs on run-command, run-tests, and run-build to bump their common-utils dependency whenever a new release is published.
  • Supports manual triggering via workflow_dispatch for ad-hoc version bumps.
  • Uses gh pr create (no third-party actions) to create PRs on dependent repos.

How it works

  1. Triggered on release publish or manual dispatch with a version tag
  2. For each dependent repo (matrix strategy, fail-fast disabled):
    • Checks out the repo using a PAT
    • Updates the common-utils git reference in package.json
    • Regenerates package-lock.json
    • Pushes a branch and opens a PR

Prerequisites

  • A REPOS_ACCESS_TOKEN secret with contents (read/write) and pull request (read/write) permissions on the dependent repos.

Comment thread .github/workflows/update-dependents.yml Fixed

@mcafaro mcafaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Definitely an improvement over manually updating each dependent repo. One thought: have we considered publishing common-utils as a scoped npm package (e.g. @matlab-actions/common-utils) so we can lean on npm's version management infrastructure? That would eliminate the need for a custom workflow and the cross-repo PAT.

Comment thread .github/workflows/update-dependents.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants