From d0c0b9b6505f77e165485fe81fdf8ad81b6f21bd Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Fri, 17 Nov 2023 03:29:51 +0000 Subject: [PATCH] ci: Refactor GitHub workflow and increase code efficiency - Remove commented out code for `SHORT_SHA` in `.github/workflows/ci.yml` - Add `SHORT_SHA` environment property with commit short sha in `.github/workflows/ci.yml` --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44a8be05..055cfb30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,6 @@ on: branches: - 'main' -env: - SHORT_SHA: "${GITHUB_SHA} | cut -c1-8`" - jobs: docker: runs-on: ubuntu-latest @@ -49,8 +46,8 @@ jobs: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - # - name: Add SHORT_SHA env property with commit short sha - # run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - name: Build and push latest