From 4d0b249f3806e8e1cd3fea47deb7ca0a01a51be1 Mon Sep 17 00:00:00 2001 From: zhiyi Date: Thu, 3 Oct 2024 03:19:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E6=94=B9auto-release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 3b4db3d..faaa986 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -24,21 +24,21 @@ jobs: run: | today=$(date +%Y%m%d) commit_count=$(git log --since="$today 00:00:00" --until="$today 23:59:59" --pretty=format: --name-only | grep -c '^gfw.pac$') - echo "::set-output name=commit_count::${commit_count}" + echo "COMMIT_COUNT=$commit_count" >> $GITHUB_ENV + echo "RELEASE_NAME=v$(TZ='Asia/Shanghai' date +%Y%m%d).$commit_count" >> $GITHUB_ENV - name: Create Tag id: create_tag run: | - tag_name=v$(date +%Y%m%d).${{ steps.commit_count.outputs.commit_count }} - git tag $tag_name - git push origin $tag_name + git tag "v${{ env.RELEASE_NAME }}" + git push origin v${{ env.RELEASE_NAME }} - name: Create Release id: create_release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: - tag_name: "v$(date +%Y%m%d).${{ steps.commit_count.outputs.commit_count }}" - name: $(date +%Y%m%d).${{ steps.commit_count.outputs.commit_count }} + tag_name: "v${{ env.RELEASE_NAME }}" + name: "v${{ env.RELEASE_NAME }}" body: "Automatically generated release for pac file update" draft: false prerelease: false @@ -46,4 +46,4 @@ jobs: - name: Verify Release run: | - echo "Release created with tag: v$(date +%Y%m%d).${{ steps.commit_count.outputs.commit_count }}" \ No newline at end of file + echo "Release created with name ${{ env.RELEASE_NAME }}" \ No newline at end of file