File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,36 @@ permissions:
1212 pull-requests : write
1313
1414jobs :
15+ check-version :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout main
19+ uses : actions/checkout@v2
20+ with :
21+ ref : main
22+ fetch-depth : 0
23+
24+ - name : Extract Major.Minor Version and setup Env variable
25+ run : |
26+ echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
27+ echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
28+
29+ - name : Get current major.minor version from main branch
30+ id : get_version
31+ run : |
32+ CURRENT_VERSION=$(grep '__version__' aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py | sed -E 's/__version__ = "([0-9]+\.[0-9]+)\.[0-9]+.*"/\1/')
33+ echo "CURRENT_MAJOR_MINOR_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
34+
35+ - name : Compare major.minor version and skip if behind
36+ if : env.CURRENT_MAJOR_MINOR_VERSION < env.MAJOR_MINOR
37+ run : |
38+ echo "Input version behind main's current major.minor version, don't need to update major version"
39+ exit 1
40+
41+
1542 prepare-main :
1643 runs-on : ubuntu-latest
44+ needs : check-version
1745 steps :
1846 - name : Setup Git
1947 uses : actions/checkout@v2
You can’t perform that action at this time.
0 commit comments