https://github.com/azu/github-actions-node-versions
Update node_versions to LTS versions in GitHub Actions.
https://github.com/azu/github-actions-node-versions
actions cli github
Last synced: 4 months ago
JSON representation
Update node_versions to LTS versions in GitHub Actions.
- Host: GitHub
- URL: https://github.com/azu/github-actions-node-versions
- Owner: azu
- License: mit
- Created: 2021-05-26T14:31:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-01T02:37:18.000Z (over 2 years ago)
- Last Synced: 2025-09-20T06:57:01.112Z (4 months ago)
- Topics: actions, cli, github
- Language: TypeScript
- Size: 78.1 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-actions-node-versions
Update `node-version` in GitHub Actions to LTS and active Node.js versions
## Examples
`npx github-actions-node-versions` update following workflow
```yaml
name: "CI"
on: [ push, pull_request ]
jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
node-version: [ 10, 12, 14 ]
name: Test(Node ${{ matrix.node }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }} # install node.js
- name: Install
run: npm install
- name: Test
run: npm test
```
to
```yaml
name: "CI"
on: [ push, pull_request ]
jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
node-version: [ 12, 14, 16 ]
name: Test(Node ${{ matrix.node-version }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }} # install node.js
- name: Install
run: npm install
- name: Test
run: npm test
```
- use `[Maintenance LTS, Active LTS, Current]` 3 versions by default
- [nodejs/Release: Node.js Release Working Group](https://github.com/nodejs/Release)
- preserved comment
## Install
Install with [npm](https://www.npmjs.com/):
npm install github-actions-node-versions
## Usage
Usage
$ github-actions-node-versions
Options
--githubDir path to .github dir (default: {cwd}/.github)
Examples
$ github-actions-node-versions
## Changelog
See [Releases page](https://github.com/azu/github-actions-node-versions/releases).
## Running tests
Install devDependencies and Run `npm test`:
npm test
## Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, [please create an issue](https://github.com/azu/github-actions-node-versions/issues).
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
## Author
- azu: [GitHub](https://github.com/azu), [Twitter](https://twitter.com/azu_re)
## License
MIT © azu