From 8d270c8c9a74f4e8495249d0b78e7cde6f51b4ab Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Fri, 17 Nov 2023 02:16:17 +0000 Subject: [PATCH] chore: Refactor code and update GitHub workflow - Remove comment section from the Footer component in Footer.js - Add environment variable `SHORT_SHA` to store the first 8 characters of the commit SHA in ci.yml file - Remove the addition of `SHORT_SHA` to the `GITHUB_ENV` file in ci.yml file --- .github/workflows/ci.yml | 9 ++++++--- web/src/components/Footer.js | 8 -------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06489bf5..44a8be05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: branches: - 'main' +env: + SHORT_SHA: "${GITHUB_SHA} | cut -c1-8`" + jobs: docker: runs-on: ubuntu-latest @@ -46,8 +49,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 @@ -62,4 +65,4 @@ jobs: with: context: . push: true - tags: ppcelery/one-api:${SHORT_SHA} + tags: ppcelery/one-api:${{ env.SHORT_SHA }} diff --git a/web/src/components/Footer.js b/web/src/components/Footer.js index 334ee379..c303e79b 100644 --- a/web/src/components/Footer.js +++ b/web/src/components/Footer.js @@ -43,14 +43,6 @@ const Footer = () => { > {systemName} {process.env.REACT_APP_VERSION}{' '} - 由{' '} - - JustSong - {' '} - 构建,源代码遵循{' '} - - MIT 协议 - )}