{"id":13698205,"url":"https://github.com/gr2m/octoherd-script-bump-node-version-in-workflows","last_synced_at":"2025-04-23T23:20:56.995Z","repository":{"id":46532972,"uuid":"407684316","full_name":"gr2m/octoherd-script-bump-node-version-in-workflows","owner":"gr2m","description":"Octoherd script to set the node-version input for actions/setup-node to the latest LTS major version","archived":false,"fork":false,"pushed_at":"2023-01-08T00:38:57.000Z","size":26,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T04:05:32.256Z","etag":null,"topics":["octoherd-script"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-17T21:30:40.000Z","updated_at":"2024-03-21T18:26:34.000Z","dependencies_parsed_at":"2023-02-08T03:46:23.649Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/octoherd-script-bump-node-version-in-workflows","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Foctoherd-script-bump-node-version-in-workflows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Foctoherd-script-bump-node-version-in-workflows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Foctoherd-script-bump-node-version-in-workflows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Foctoherd-script-bump-node-version-in-workflows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/octoherd-script-bump-node-version-in-workflows/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250403833,"owners_count":21424795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["octoherd-script"],"created_at":"2024-08-02T19:00:41.505Z","updated_at":"2025-04-23T23:20:56.965Z","avatar_url":"https://github.com/gr2m.png","language":"JavaScript","funding_links":[],"categories":["Scripts"],"sub_categories":[],"readme":"# octoherd-script-bump-node-version-in-workflows\n\n\u003e Octoherd script to set the node-version input for actions/setup-node to the latest LTS major version\n\n[![@latest](https://img.shields.io/npm/v/octoherd-script-bump-node-version-in-workflows.svg)](https://www.npmjs.com/package/octoherd-script-bump-node-version-in-workflows)\n[![Build Status](https://github.com/gr2m/octoherd-script-bump-node-version-in-workflows/workflows/Test/badge.svg)](https://github.com/gr2m/octoherd-script-bump-node-version-in-workflows/actions?query=workflow%3ATest+branch%3Amain)\n\n## Usage\n\nNote: You **must** set a custom token for this script because it requires the `workflow` scope. [Create a token here](https://github.com/settings/tokens/new?scopes=workflow,repo\u0026description=octoherd-script-bump-node-version-in-workflows)\n\nMinimal usage\n\n```js\nnpx octoherd-script-bump-node-version-in-workflows -T ghp_0123456789abcdefghjklmnopqrstuvwxyzA\n```\n\nPass all options as CLI flags to avoid user prompts\n\n```js\nnpx octoherd-script-bump-node-version-in-workflows@latest \\\n  -T ghp_0123456789abcdefghjklmnopqrstuvwxyzA \\\n  -R \"gr2m/*\" \\\n  --node-version \"lts/*\" \\\n  --workflow release.yml\n```\n\nThe script uses [`js-yaml`](https://github.com/nodeca/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.\n\nIf `node-version` is set to a value which includes a `${{ ... }}` placeholder then it's not updated.\n\nI run the script against all [@octokit repositories](https://github.com/orgs/octokit/repositories) so I'm fairly confident it doesn't break anything.\n\n## Options\n\n| option                       | type             | description                                                                                                                                                                                                                                 |\n| ---------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `--node-version`             | number           | **Required** May be set to `lts/*`. See [all supported versions](https://github.com/actions/setup-node#supported-version-syntax)                                                                                                            |\n| `--workflow`                 | string           | workflow file name or pattern to only update a subset of workflows. [matcher](https://github.com/sindresorhus/matcher#usage) is used for matching. Defaults to `*`                                                                          |\n| `--octoherd-token`, `-T`     | string           | A personal access token ([create](https://github.com/settings/tokens/new?scopes=repo)). Script will create one if option is not set                                                                                                         |\n| `--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 |\n| `--octoherd-bypass-confirms` | boolean          | Bypass prompts to confirm mutating requests                                                                                                                                                                                                 |\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## About Octoherd\n\n[@octoherd](https://github.com/octoherd/) is project to help you keep your GitHub repositories in line.\n\n## License\n\n[ISC](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Foctoherd-script-bump-node-version-in-workflows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Foctoherd-script-bump-node-version-in-workflows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Foctoherd-script-bump-node-version-in-workflows/lists"}