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
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: git config user.name 'github-actions[bot]'
- run: git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- run: npm ci
- run: npm version patch
- run: git push --follow-tags
- name: Bump version (patch)
run: |
LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1
NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1
[ "${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
# 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
@ -79,5 +86,5 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
##ETHERPAD_NPM_V=2
## NPM configuration automatically created using src/bin/plugins/updateAllPluginsScript.sh
# Automatically generated by src/bin/plugins/checkPlugin.js
##ETHERPAD_NPM_V=3