From fa5372328307fc655464de36279dbdb50d6b1ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=85=8E=E9=A5=BC=E6=9E=9C=E5=AD=90=E5=8D=B7=E9=B2=A8?= =?UTF-8?q?=E9=B1=BC=E8=BE=A3=E6=A4=92?= Date: Mon, 30 Dec 2024 18:03:05 +0800 Subject: [PATCH] chore: update GitHub Actions workflows for auto-tagging and release processes - Updated permissions in both auto-tag.yml and release.yml to include write access for issues and pull requests. - Changed the checkout action version from v4 to v3 in both workflows for consistency. - Updated Go setup action version from v5 to v4 and specified the Go version as "1.21". - Adjusted GPG import action version from v6 to v5. - Updated GoReleaser action version from v5 to v4 and specified the release version as v1.21.2. - Standardized string quotes in YAML files for consistency. --- .github/workflows/auto-tag.yml | 19 +++++++++++++------ .github/workflows/release.yml | 16 +++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index adfe54b..1ed02b5 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -6,22 +6,24 @@ on: - master - main paths-ignore: - - '**.md' - - 'LICENSE' - - '.gitignore' + - "**.md" + - "LICENSE" + - ".gitignore" jobs: auto-tag: runs-on: ubuntu-latest permissions: contents: write + issues: write + pull-requests: write outputs: new_tag: ${{ steps.get_latest_tag.outputs.version }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: fetch-depth: 0 - + - name: Get latest tag id: get_latest_tag run: | @@ -50,4 +52,9 @@ jobs: release: needs: auto-tag uses: ./.github/workflows/release.yml - secrets: inherit \ No newline at end of file + permissions: + contents: write + packages: write + issues: write + pull-requests: write + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fccb6f0..a7048d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,18 +4,20 @@ on: workflow_call: push: tags: - - 'v*' + - "v*" permissions: contents: write packages: write + issues: write + pull-requests: write jobs: goreleaser: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: fetch-depth: 0 lfs: true @@ -29,24 +31,24 @@ jobs: ls -R - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: "1.21" cache: true - name: Import GPG key id: import_gpg - uses: crazy-max/ghaction-import-gpg@v6 + uses: crazy-max/ghaction-import-gpg@v5 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.PASSPHRASE }} if: ${{ env.GPG_PRIVATE_KEY != '' }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 + uses: goreleaser/goreleaser-action@v4 with: distribution: goreleaser - version: latest + version: v1.21.2 args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}