Skip to content

chore: update template #9

chore: update template

chore: update template #9

Workflow file for this run

name: Release Check
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check Source Branch
run: python2 -c "exit(0 if '${{ github.head_ref }}'.startswith('release') or '${{ github.head_ref }}'.startswith('hotfix') else 1)"
- name: Check Version
run: |

Check failure on line 18 in .github/workflows/release-check.yml

View workflow run for this annotation

GitHub Actions / Release Check

Invalid workflow file

The workflow is not valid. .github/workflows/release-check.yml (Line: 18, Col: 14): Unrecognized named-value: 'Head'. Located at position 1 within expression: Head.SHA
# get version code, runner not support grep -E here
SOURCE_VERSION=`grep 'Version\s*=\s*\"v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\"' *.go | awk -F '\"' '{print $(NF-1)}'`
git checkout main
MASTER_VERSION=`grep 'Version\s*=\s*\"v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\"' *.go | awk -F '\"' '{print $(NF-1)}'`
git checkout ${{Head.SHA}}
# check version update
python2 -c "exit(0 if list(map(int,'${SOURCE_VERSION#v}'.split('.')[:3])) > list(map(int,'${MASTER_VERSION#v}'.split('.')[:3])) else 1)"