From 573e1edbe5106779a139832cb9d24dadbc4774e4 Mon Sep 17 00:00:00 2001 From: Michael Duong Date: Fri, 15 Sep 2023 19:45:41 +0100 Subject: [PATCH] try new model --- .github/workflows/MLPipelinePostMerge.yml | 35 ++++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/MLPipelinePostMerge.yml b/.github/workflows/MLPipelinePostMerge.yml index cd239cd..1767cd6 100644 --- a/.github/workflows/MLPipelinePostMerge.yml +++ b/.github/workflows/MLPipelinePostMerge.yml @@ -1,22 +1,22 @@ name: Register the model for the given pipeline branch -on: - push: - branches: - - "model-**" - # on: -# pull_request: -# types: -# - closed +# push: # branches: -# - "master" +# - "model-**" + +on: + pull_request: + types: + - closed + branches: + - "master" permissions: write-all jobs: Register-Major-Model-Dev: - # if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'major')) }} + if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'major')) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -30,9 +30,8 @@ jobs: - name: Register Model run: | - # REGISTER_MODEL_NAME=$(echo ${{ github.event.pull_request.head.ref }} | awk -F"-" '{print $1}') + REGISTER_MODEL_NAME=$(echo ${{ github.event.pull_request.head.ref }} | awk -F"-" '{print $1}') # REGISTER_MODEL_NAME=$(echo ${{github.ref_name}} | awk -F"-" '{print $1}') - REGISTER_MODEL_NAME=bob git config user.name "Github-Bot" git config user.email "Github-Bot@no-reply.com" @@ -76,7 +75,11 @@ jobs: git config user.email "Github-Bot@no-reply.com" latest_version=$(gto show ${REGISTER_MODEL_NAME}@latest --ref | awk -F"@v" '{print $2}') - increment_version=$(echo ${latest_version} | awk 'BEGIN{FS=OFS="."} {$2++; print}') + if [ -z "${latest_version}" ]; then + increment_version="0.1.0" + else + increment_version=$(echo ${latest_version} | awk 'BEGIN{FS=OFS="."} {$2++; print}') + fi new_tag=${REGISTER_MODEL_NAME}@v${increment_version} @@ -110,7 +113,11 @@ jobs: git config user.email "Github-Bot@no-reply.com" latest_version=$(gto show ${REGISTER_MODEL_NAME}@latest --ref | awk -F"@v" '{print $2}') - increment_version=$(echo ${latest_version} | awk 'BEGIN{FS=OFS="."} {$3++; print}') + if [ -z "${latest_version}" ]; then + increment_version="0.0.1" + else + increment_version=$(echo ${latest_version} | awk 'BEGIN{FS=OFS="."} {$3++; print}') + fi new_tag=${REGISTER_MODEL_NAME}@v${increment_version}