github-actions-node-versions

Update node_versions to LTS versions in GitHub Actions.

Usage no npm install needed!

<script type="module">
  import githubActionsNodeVersions from 'https://cdn.skypack.dev/github-actions-node-versions';
</script>

README

github-actions-node-versions

Update node_versions in GitHub Actions to LTS and active Node.js versions

Examples

npx github-actions-node-versions update following workflow

name: "CI"
on: [ push, pull_request ]

jobs:
  test:
    strategy:
      matrix:
        os: [ ubuntu-latest, windows-latest ]
        node: [ 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 }} # install node.js
      - name: Install
        run: npm install
      - name: Test
        run: npm test

to

name: "CI"
on: [ push, pull_request ]

jobs:
  test:
    strategy:
      matrix:
        os: [ ubuntu-latest, windows-latest ]
        node: [ 12, 14, 16 ]
    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 }} # install node.js
      - name: Install
        run: npm install
      - name: Test
        run: npm test

Install

Install with npm:

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.

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.

  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

License

MIT © azu