Skip to content

depth

depth #10

Workflow file for this run

name: Branch check
on: [ push ]
jobs:
check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
# So that we get the branch for `base_ref`.
fetch-depth: 0

Check failure on line 9 in .github/workflows/branchCheck.yml

View workflow run for this annotation

GitHub Actions / Branch check

Invalid workflow file

The workflow is not valid. .github/workflows/branchCheck.yml (Line: 9, Col: 7): Unexpected value 'fetch-depth'
- name: Check branch
run: |
import os
import re
import subprocess
def version() :
versions = {}
versionRe = re.compile( r"^(gaffer.*Version.*) = (\S+)" )
with open( "SConstruct" ) as sconstruct :
for line in sconstruct.readlines() :
versionMatch = versionRe.match( line )
if versionMatch :
versions[versionMatch.group( 1 )] = versionMatch.group( 2 ).strip( "'\"" )
return [
int( versions["gafferMilestoneVersion"] ),
int( versions["gafferMajorVersion"] ),
int( versions["gafferMinorVersion"] ),
int( versions["gafferPatchVersion"] ),
]
mergedVersion = version()
print( mergedVersion )
sourceBranch = "main" #os.environ["GITHUB_HEAD_REF"]
subprocess.check_call( [ "git", "checkout", sourceBranch ] )
sourceVersion = version()
if sourceVersion != mergedVersion :
sys.stderr.write(
"Source branch version {} does not match merged version {}\n".format(
sourceVersion, mergedVersion
)
)
sys.exit( 1 )
print( os.environ )
shell: python