From 91d5003c61371dc3deca87732302c6ed497e3ca2 Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Fri, 17 Nov 2023 02:04:03 +0000 Subject: [PATCH] ci: Update image tag for GitHub Actions in ci.yml - Change image tags to use SHORT_SHA instead of github.sha in .github/workflows/ci.yml --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5fd947e..06489bf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,9 @@ 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: Build and push latest uses: docker/build-push-action@v4 @@ -59,4 +62,4 @@ jobs: with: context: . push: true - tags: ppcelery/one-api:${{ github.sha }} + tags: ppcelery/one-api:${SHORT_SHA}