Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Aug 5, 2024
1 parent fe1a53e commit 698af31
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/branchCheck.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Branch check
on: [ push ]
on: pull_request:
branches:
- '*'
jobs:
check:
runs-on: ubuntu-20.04
Expand All @@ -9,6 +11,7 @@ jobs:
run: |
import os
import re
import subprocess
def version() :
Expand All @@ -25,6 +28,18 @@ jobs:
currentVersion = version()
print( currentVersion )
targetBranch = os.environ["GITHUB_BASE_REF"]
subprocess.check_call( [ "git", "checkout", targetBranch ] )
targetVersion = version()
if targetVersion != currentVersion :
sys.stderr.write(
"Current version {} does not match target branch version {}\n".format(
currentVersion, targetVersion
)
)
sys.exit( 1 )
print( os.environ )
shell: python

0 comments on commit 698af31

Please sign in to comment.