Skip to content

Commit

Permalink
wop
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Aug 5, 2024
1 parent 698af31 commit 85332be
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/branchCheck.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Branch check
on: pull_request:
branches:
- '*'
on: [ push ]
jobs:
check:
runs-on: ubuntu-20.04
Expand All @@ -23,19 +21,24 @@ jobs:
if versionMatch :
versions[versionMatch.group( 1 )] = versionMatch.group( 2 ).strip( "'\"" )
return [ int( versions["gafferMilestoneVersion"] ), int( versions["gafferMajorVersion"] ) ]
return [
int( versions["gafferMilestoneVersion"] ),
int( versions["gafferMajorVersion"] ),
int( versions["gafferMinorVersion"] ),
int( versions["gafferPatchVersion"] ),
]
currentVersion = version()
print( currentVersion )
mergedVersion = version()
print( mergedVersion )
targetBranch = os.environ["GITHUB_BASE_REF"]
sourceBranch = "main" #os.environ["GITHUB_HEAD_REF"]
subprocess.check_call( [ "git", "checkout", targetBranch ] )
targetVersion = version()
sourceVersion = version()
if targetVersion != currentVersion :
if sourceVersion != mergedVersion :
sys.stderr.write(
"Current version {} does not match target branch version {}\n".format(
currentVersion, targetVersion
"Source branch version {} does not match merged version {}\n".format(
sourceVersion, mergedVersion
)
)
sys.exit( 1 )
Expand Down

0 comments on commit 85332be

Please sign in to comment.