File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Version Bump
2+ on :
3+ push : { branches: main, paths: "share/node-build/**" }
4+ schedule : [{ cron: "0 10 * * SAT" }] # weekly: https://crontab.guru/#0_10_*_*_SAT
5+ workflow_dispatch :
6+ inputs :
7+ version : # checkov:skip=CKV_GHA_7
8+ description : " An explicit version (or major|minor|patch) to tag."
9+ default : " "
10+ required : false
11+ type : string
12+
13+ permissions : { contents: read }
14+ jobs :
15+ bump :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
19+ with : { egress-policy: audit }
20+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+ with :
22+ fetch-depth : 0
23+ token : ${{ secrets.BOT_TOKEN }}
24+
25+ - if : ${{ !inputs.version }}
26+ run : |-
27+ npm run preversion --silent -- -o -v -- share/node-build || status=$?
28+ case "${status:-0}" in
29+ 0) echo "bump=patch" >> "$GITHUB_ENV";;
30+ 1) exit 0;; # exit successfully to mask error, but don't release
31+ *) exit "$status" ;; # all other error codes are true failures
32+ esac
33+
34+ - if : ${{ inputs.version || env.bump }}
35+ run : npm version ${{ inputs.version || env.bump }}
36+ env :
37+ GIT_AUTHOR_NAME : ${{ vars.NODENV_BOT_NAME }}
38+ GIT_AUTHOR_EMAIL : ${{ vars.NODENV_BOT_EMAIL }}
39+ GIT_COMMITTER_NAME : ${{ vars.GHA_BOT_NAME }}
40+ GIT_COMMITTER_EMAIL : ${{ vars.GHA_BOT_EMAIL }}
You can’t perform that action at this time.
0 commit comments