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}