From 8f8b18a51fd3e524a5f6a2c4aae738bfe5ad14f2 Mon Sep 17 00:00:00 2001 From: appleboy Date: Sat, 22 Jun 2024 11:00:35 +0800 Subject: [PATCH] style: standardize code style and update version extraction - Change single quotes to double quotes in YAML files - Update REPO_VERSION extraction method to use GITHUB_REF_NAME without the 'v' prefix Signed-off-by: appleboy --- .gitea/workflows/release-nightly.yml | 12 ++++++------ .gitea/workflows/release-tag.yml | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/release-nightly.yml b/.gitea/workflows/release-nightly.yml index 497f5ad..d6afae9 100644 --- a/.gitea/workflows/release-nightly.yml +++ b/.gitea/workflows/release-nightly.yml @@ -2,9 +2,9 @@ name: release-nightly on: push: - branches: [ main ] + branches: [main] tags: - - '*' + - "*" jobs: goreleaser: @@ -15,7 +15,7 @@ jobs: fetch-depth: 0 # all history for all branches and tags - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: "go.mod" - name: goreleaser uses: goreleaser/goreleaser-action@v5 with: @@ -29,7 +29,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} S3_REGION: ${{ secrets.AWS_REGION }} S3_BUCKET: ${{ secrets.AWS_BUCKET }} - GORELEASER_FORCE_TOKEN: 'gitea' + GORELEASER_FORCE_TOKEN: "gitea" GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} release-image: runs-on: ubuntu-latest @@ -60,7 +60,7 @@ jobs: id: meta run: | echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT - echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT + echo REPO_VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_OUTPUT - name: Build and push uses: docker/build-push-action@v5 @@ -77,7 +77,7 @@ jobs: - name: Build and push dind-rootless uses: docker/build-push-action@v5 env: - ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 + ACTIONS_RUNTIME_TOKEN: "" # See https://gitea.com/gitea/act_runner/issues/119 with: context: . file: ./Dockerfile.rootless diff --git a/.gitea/workflows/release-tag.yml b/.gitea/workflows/release-tag.yml index 0a09ced..58469a0 100644 --- a/.gitea/workflows/release-tag.yml +++ b/.gitea/workflows/release-tag.yml @@ -3,7 +3,7 @@ name: release-tag on: push: tags: - - '*' + - "*" jobs: goreleaser: @@ -14,7 +14,7 @@ jobs: fetch-depth: 0 # all history for all branches and tags - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: "go.mod" - name: Import GPG key id: import_gpg uses: crazy-max/ghaction-import-gpg@v6 @@ -25,9 +25,9 @@ jobs: - name: goreleaser uses: goreleaser/goreleaser-action@v5 with: - distribution: goreleaser-pro - version: latest - args: release + distribution: goreleaser-pro + version: latest + args: release env: GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} AWS_REGION: ${{ secrets.AWS_REGION }} @@ -35,7 +35,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} S3_REGION: ${{ secrets.AWS_REGION }} S3_BUCKET: ${{ secrets.AWS_BUCKET }} - GORELEASER_FORCE_TOKEN: 'gitea' + GORELEASER_FORCE_TOKEN: "gitea" GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} release-image: @@ -67,7 +67,7 @@ jobs: id: meta run: | echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT - echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT + echo REPO_VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_OUTPUT - name: Build and push uses: docker/build-push-action@v5 @@ -85,7 +85,7 @@ jobs: - name: Build and push dind-rootless uses: docker/build-push-action@v5 env: - ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 + ACTIONS_RUNTIME_TOKEN: "" # See https://gitea.com/gitea/act_runner/issues/119 with: context: . file: ./Dockerfile.rootless