Skip to content

gr2m/octoherd-script-bump-node-version-in-workflows

Repository files navigation

octoherd-script-bump-node-version-in-workflows

Octoherd script to set the node-version input for actions/setup-node to the latest LTS major version

@latest Build Status

Usage

Note: You must set a custom token for this script because it requires the workflow scope. Create a token here

Minimal usage

npx octoherd-script-bump-node-version-in-workflows -T ghp_0123456789abcdefghjklmnopqrstuvwxyzA

Pass all options as CLI flags to avoid user prompts

npx octoherd-script-bump-node-version-in-workflows@latest \
  -T ghp_0123456789abcdefghjklmnopqrstuvwxyzA \
  -R "gr2m/*" \
  --node-version "lts/*" \
  --workflow release.yml

The script uses js-yaml, so the updated YAML code might also include formatting changes. Unfortunately the parsing and then serializing using js-yaml removes all comments. But the script will only update a file if a node-version was actually changed.

If node-version is set to a value which includes a ${{ ... }} placeholder then it's not updated.

I run the script against all @octokit repositories so I'm fairly confident it doesn't break anything.

Options

option type description
--node-version number Required May be set to lts/*. See all supported versions
--workflow string workflow file name or pattern to only update a subset of workflows. matcher is used for matching. Defaults to *
--octoherd-token, -T string A personal access token (create). Script will create one if option is not set
--octoherd-repos, -R array of strings One or multiple space-separated repositories in the form of repo-owner/repo-name. repo-owner/* will find all repositories for one owner. * will find all repositories the user has access to. Will prompt for repositories if not set
--octoherd-bypass-confirms boolean Bypass prompts to confirm mutating requests

Contributing

See CONTRIBUTING.md

About Octoherd

@octoherd is project to help you keep your GitHub repositories in line.

License

ISC

About

Octoherd script to set the node-version input for actions/setup-node to the latest LTS major version

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published