checkPlugin: Don't bump version if there are no changes

This commit is contained in:
Richard Hansen 2021-06-14 14:46:04 -04:00
parent 4d457f6296
commit b7de4faf42

View file

@ -56,15 +56,22 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: 12 node-version: 12
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.org/
- run: git config user.name 'github-actions[bot]' - name: Bump version (patch)
- run: git config user.email '41898282+github-actions[bot]@users.noreply.github.com' run: |
- run: npm ci LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1
- run: npm version patch NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1
- run: git push --follow-tags [ "${NEW_COMMITS}" -gt 0 ] || exit 0
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
npm ci
npm version patch
git push --follow-tags
# `npm publish` must come after `git push` otherwise there is a race # `npm publish` must come after `git push` otherwise there is a race
# condition: If two PRs are merged back-to-back then master/main will be # condition: If two PRs are merged back-to-back then master/main will be
# updated with the commits from the second PR before the first PR's # updated with the commits from the second PR before the first PR's
@ -79,5 +86,5 @@ jobs:
env: env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
##ETHERPAD_NPM_V=2 # Automatically generated by src/bin/plugins/checkPlugin.js
## NPM configuration automatically created using src/bin/plugins/updateAllPluginsScript.sh ##ETHERPAD_NPM_V=3