Skip to content

Commit

Permalink
added github action for pull requests to make sure the version string…
Browse files Browse the repository at this point in the history
… was bumped
  • Loading branch information
JakeTRogers committed Jan 13, 2024
1 parent 715e264 commit a951f0e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/verBumpChkr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Version Bump Check

on:
pull_request:
types: [opened, reopened, synchronize]

env:
FILE_PATH: 'cmd/root.go' # Path to file with version string
VERSION_PATTERN: 'Version: "v[0-9]\+\.[0-9]\+\.[0-9]\+",' # Version string regex pattern

jobs:
version-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 2
- name: Check if Version String is Updated
run: |
if git diff -U0 ${{ github.head_ref }}...${{ github.base_ref }} -- "$FILE_PATH" | grep -q "$VERSION_PATTERN"; then
echo "### ✅ Version updated in $FILE_PATH" >> "$GITHUB_STEP_SUMMARY"
else
echo "### ❌ Version NOT updated in $FILE_PATH" >> "$GITHUB_STEP_SUMMARY"
exit 1
fi

0 comments on commit a951f0e

Please sign in to comment.