name: Version Bump
on:
  schedule: [{ cron:  '0 10 * * *' }] # daily: https://crontab.guru/#0_0_*_*_*
  workflow_dispatch:

jobs:
  bump:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          token: ${{ secrets.BOT_TOKEN }}

      - run: |-
          npm run preversion --silent -- -o -v -- share/node-build || status=$?
          case "${status:-0}" in
            0) echo "::set-env name=release::true" ;;
            1) exit 0;; # exit successfully to mask error, but don't release
            *) exit $status ;; # all other error codes are true failures
          esac

      - if: ${{ env.release }}
        run: npm version patch
        env:
          GIT_AUTHOR_NAME: 'nodenv bot'
          GIT_AUTHOR_EMAIL: 'nodenv-bot@users.noreply.github.com'
          GIT_COMMITTER_NAME: 'nodenv bot'
          GIT_COMMITTER_EMAIL: 'nodenv-bot@users.noreply.github.com'

name: Version Bump
on:
  schedule: [{ cron:  '0 10 * * *' }] # daily: https://crontab.guru/#0_0_*_*_*
  workflow_dispatch:

jobs:
  bump:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          token: ${{ secrets.BOT_TOKEN }}

      - run: |-
          npm run preversion --silent -- -o -v -- share/node-build || status=$?
          case "${status:-0}" in
            0) echo "release=true" >> $GITHUB_ENV;;
            1) exit 0;; # exit successfully to mask error, but don't release
            *) exit $status ;; # all other error codes are true failures
          esac

      - if: ${{ env.release }}
        run: npm version patch
        env:
          GIT_AUTHOR_NAME: 'nodenv bot'
          GIT_AUTHOR_EMAIL: 'nodenv-bot@users.noreply.github.com'
          GIT_COMMITTER_NAME: 'nodenv bot'
          GIT_COMMITTER_EMAIL: 'nodenv-bot@users.noreply.github.com'

Use new GH Actions process for setting env vars
Use new GH Actions process for setting env vars

No longer possible to set-env directly:

https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/