Merge pull request #461 from nodenv/scrape/definitions #314
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Version Bump | |
| on: | |
| push: { branches: main, paths: "share/node-build/**" } | |
| schedule: [{ cron: "0 10 * * SAT" }] # weekly: https://crontab.guru/#0_10_*_*_SAT | |
| workflow_dispatch: | |
| inputs: | |
| version: # checkov:skip=CKV_GHA_7 | |
| description: "An explicit version (or major|minor|patch) to tag." | |
| default: "" | |
| required: false | |
| type: string | |
| permissions: { contents: read } | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: { egress-policy: audit } | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.BOT_TOKEN }} | |
| persist-credentials: true # need creds for subsequent git ops | |
| - if: ${{ !inputs.version }} | |
| run: |- | |
| npm run preversion --silent -- -o -v -- share/node-build || status=$? | |
| case "${status:-0}" in | |
| 0) echo "bump=patch" >> "$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: ${{ inputs.version || env.bump }} | |
| run: npm version "$NEWVERSION" | |
| env: | |
| GIT_AUTHOR_NAME: ${{ vars.NODENV_BOT_NAME }} | |
| GIT_AUTHOR_EMAIL: ${{ vars.NODENV_BOT_EMAIL }} | |
| GIT_COMMITTER_NAME: ${{ vars.GHA_BOT_NAME }} | |
| GIT_COMMITTER_EMAIL: ${{ vars.GHA_BOT_EMAIL }} | |
| NEWVERSION: ${{ inputs.version || env.bump }} |