From d05e4f8c3aca0cb1065a1a04454895536bf61f7b Mon Sep 17 00:00:00 2001 From: Levi Zim Date: Mon, 19 May 2025 12:03:17 +0800 Subject: [PATCH] Run CI for PRs --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 752f555..40c023f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: tags: - "[0-9]+.[0-9]+.[0-9]+-[0-9]+" + pull_request: permissions: contents: write @@ -12,9 +13,12 @@ jobs: upload-assets: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - id: get-upstream-tag run: | - tag=$(echo ${{ github.ref_name }} | cut -d- -f1) + tag=$(echo ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '$(git describe --tags --abbrev=0)' }} | cut -d- -f1) echo "::set-output name=tag::$tag" - uses: actions/checkout@v4 with: @@ -39,6 +43,7 @@ jobs: run: | riscv64-linux-gnu-strip out/rg - name: Release + if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: files: out/rg