-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sometimes I forget to bump the version. So here is an action to check and yell at me when I forget
- Loading branch information
1 parent
936a43c
commit 0e40698
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Check Version Bump | ||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
check-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: johnnybenson/package-json-versioned-action@v1.0.5 | ||
id: package-json | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- run: echo "has-updated -- ${{ steps.package-json.outputs.has-updated }}" | ||
- run: echo "previous-version -- ${{ steps.package-json.outputs.previous-version }}" | ||
- run: echo "version -- ${{ steps.package-json.outputs.version }}" | ||
# the action will fail if the version has not been updated | ||
- run: | | ||
if [ "${{ steps.package-json.outputs.has-updated }}" = "false" ]; then | ||
echo "The version has not been updated" | ||
exit 1 | ||
fi |