This is a GitHub action that allows you to automatically deploy new packages from a source repo to various dependent repos.
A concrete example would be you have 30 VitePress sites that rely on a custom theme. When that custom theme pushes a new stable release to npm
it also automatically opens a pull request on all 30 sites with the updated npm
pacakge.
In this way it is sorta like dependapot
except that the source repo pushes updates to its dependents as opposed to the dependent periodically looking for upstream updates.
It currently comes with the following caveats:
- Only works with
yarn
andnpm
as package managers (would love to add support forcomposer
,pip
etc) - Only works with
npm
,yarn
andgithub
as "upstream" registries - Only works
GitHub
repo toGitHub
repo - User is responsible for installing any underlying deps (eg
node
andyarn
) required by this action
These keys must be set correctly for the action to work.
Name | Description | Example Value |
---|---|---|
slug |
The GitHub repo slug you want to deploy the update package to. | lando/php |
These keys are set to sane defaults but can be modified as needed.
Name | Description | Default | Example |
---|---|---|---|
args |
Extra options to pass into the manager update command. | "" | --dev |
branch |
The branch to deploy the updated package to. | Automatically created. If pr is false then the Default branch for slug . |
master |
dirs |
The dirs containing a package.json to update. | ./ |
./,./subdir1,./subdir2 |
manager |
The package manager to use for updating. | npm |
yarn | npm |
package |
The name of the package to update. | Set based on registry |
@lando/php |
pr |
Open a pull request with the change. | true |
false |
pr-base |
The base branch to open the PR against. | main |
master |
registry |
The place we should get the updated package from. | npm |
yarn | npm | github |
separator |
The character that separates the package and version in the package manager update command |
Set based on registry |
@ |
token |
GitHub Personal Access Token with permission to read/write to target slug |
${{ github.token }} . |
MYTOKEN |
version |
The version of the package to update to. | Set based on registry |
1.3.2 |
These keys are usually not needed but can be useful for testing.
Name | Description | Default | Example |
---|---|---|---|
deploy |
Toggle to disable deployment. Will --dry-run the git push . |
true |
false |
update |
Toggle to disable updating. | true |
false |
These outputs are mostly used internally but are nonetheless available.
outputs:
branch:
description: "The branch to deploy to."
value: ${{ steps.auto-deploy-action.outputs.branch }}
package:
description: "The package name from user or manifest file to auto deploy."
value: ${{ steps.auto-deploy-action.outputs.package }}
version:
description: "The package version from user or manifest file to auto deploy."
value: ${{ steps.auto-deploy-action.outputs.version }}
separator:
description: "The separator between package and version"
value: ${{ steps.auto-deploy-action.outputs.separator }}
We try to log all changes big and small in both THE CHANGELOG and the release notes.
Create a release and publish to GitHub Actions Marketplace. Note that the release tag must be a semantic version.
Made with contrib.rocks.