Skip to content

GitHub Action

@simple-release/node-gha releases a Node.js GitHub Action itself. Unlike npm packages, actions are consumed straight from git refs — so instead of a registry, NodeGhaProject publishes the built action state to branches and tags:

  • the latest branch is created from the current release commit;
  • the v{major} branch points to the built latest state;
  • the v{version} tag points to the built latest state.

Consumers can then use your/action@latest, @v2, or @v2.0.1.

pnpm add @simple-release/node-gha
.simple-release.json
{
"project": "@simple-release/node-gha#NodeGhaProject",
"publish": {
"build": "pnpm install --prod --config.node-linker=hoisted",
"files": ["node_modules", "src", "action.yml"]
}
}

If build is provided, the command runs on the latest branch: after it completes, the files from the files option are force-added and the release commit is amended before the refs are pushed. This is how node_modules or a compiled bundle end up in the published action without polluting the main branch.

This addon targets Node.js actions that use package.json as the release manifest. Composite and Docker actions can use custom project addons if they do not have a package.json.

OptionDescription
pathPath to the package.json manifest file. Defaults to 'package.json'.
changelogFilePath to the changelog file. Defaults to 'CHANGELOG.md'.
composeFunction to compose the main manifest with secondary manifests where the version should also be updated. Optional.
OptionDescription
skipSkip publishing.
latestBranchBranch that points to the latest built action state. Defaults to 'latest'.
majorBranchPrefixPrefix for the major branch. Defaults to 'v'.
tagPrefixPrefix for version tags. Defaults to 'v'.
buildBuild or install command to run before publishing refs. Optional.
filesFiles to stage after build. Defaults to the package.json files field.
envEnvironment variables to set before running build commands. Defaults to process.env.