From cf0fb1c00d21bef4e826053ea3cff9cd0790656d Mon Sep 17 00:00:00 2001 From: ParaN3xus <136563585+ParaN3xus@users.noreply.github.com> Date: Fri, 1 Aug 2025 16:08:08 +0800 Subject: [PATCH] fix: several fixes to auto release (#1959) + use `GITHUB_TOKEN` to checkout tinymist in `release-nightly.yml`. Therefore, GitHub Actions should be granted write permission. + tag directives must start from the line start. + use the same bot name and email in actions. --- .github/workflows/auto-tag.yml | 3 ++- .github/workflows/detect-pr-tag.yml | 2 +- .github/workflows/release-nightly.yml | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 10675efee..43bbe11a3 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -57,7 +57,8 @@ jobs: const prBody = pr.body || ''; console.log('PR Body:', prBody); - const tagRegex = /\+tag\s+(v\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+)?)/; + const tagRegex = /^\+tag\s+(v\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+)?)/m; + const match = prBody.match(tagRegex); if (match) { diff --git a/.github/workflows/detect-pr-tag.yml b/.github/workflows/detect-pr-tag.yml index eb45bebf4..7a16f4b2e 100644 --- a/.github/workflows/detect-pr-tag.yml +++ b/.github/workflows/detect-pr-tag.yml @@ -19,7 +19,7 @@ jobs: const prBody = context.payload.pull_request.body || ''; console.log('PR Body:', prBody); - const tagRegex = /\+tag\s+(v\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+)?)/; + const tagRegex = /^\+tag\s+(v\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+)?)/m; const match = prBody.match(tagRegex); if (match) { diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 77af6443e..7586cf060 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -18,12 +18,14 @@ on: jobs: check-and-release: runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout repository uses: actions/checkout@v4 with: ref: nightly - token: ${{ secrets.NIGHTLY_REPO_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 - name: Install Node.js @@ -36,8 +38,8 @@ jobs: - name: Setup Git run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" - name: Install system dependencies run: |