From d879bdcdc42443ccb8fb13f4c3df783a4d56c887 Mon Sep 17 00:00:00 2001 From: bvzrays <1372627285@qq.com> Date: Wed, 2 Dec 2026 14:06:20 +0800 Subject: [PATCH 1/2] ci: follow host Go version in market workflows --- .github/workflows/pr-check.yml | 18 +++++++++++++----- .github/workflows/publish.yml | 17 ++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index ccb4705..fd96c22 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -3,6 +3,7 @@ name: PR Plugin Gate on: pull_request: paths: + - '.github/workflows/**' - 'registry.json' - 'withdrawn.json' - 'scripts/**' @@ -30,17 +31,24 @@ jobs: count=$(node -e "const r = JSON.parse(require('fs').readFileSync('registry.json','utf8')); console.log((r.plugins||[]).length)") echo "count=$count" >> "$GITHUB_OUTPUT" - - name: Setup Go for reims-go doctor CLI + - name: Checkout Reims-Go CLI source + if: steps.reg.outputs.count != '0' + uses: actions/checkout@v4 + with: + repository: Nwflower/Reims-Go + ref: main + path: reims-go + + - name: Setup Go from Reims-Go go.mod if: steps.reg.outputs.count != '0' uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version-file: reims-go/go.mod - - name: Build headless reims-go CLI from Nwflower/Reims-Go + - name: Build headless reims-go CLI if: steps.reg.outputs.count != '0' run: | - git clone --depth 1 https://github.com/Nwflower/Reims-Go.git /tmp/reims-go-src - cd /tmp/reims-go-src + cd reims-go mkdir -p cmd/reims-doctor cat <<'EOF' > cmd/reims-doctor/main.go package main diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4cc0ca8..18ac330 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,17 +36,24 @@ jobs: count=$(node -e "const r = JSON.parse(require('fs').readFileSync('registry.json','utf8')); console.log((r.plugins||[]).length)") echo "count=$count" >> "$GITHUB_OUTPUT" - - name: Setup Go for reims-go doctor CLI + - name: Checkout Reims-Go CLI source + if: steps.reg.outputs.count != '0' + uses: actions/checkout@v4 + with: + repository: Nwflower/Reims-Go + ref: main + path: reims-go + + - name: Setup Go from Reims-Go go.mod if: steps.reg.outputs.count != '0' uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version-file: reims-go/go.mod - - name: Build headless reims-go CLI from Nwflower/Reims-Go + - name: Build headless reims-go CLI if: steps.reg.outputs.count != '0' run: | - git clone --depth 1 https://github.com/Nwflower/Reims-Go.git /tmp/reims-go-src - cd /tmp/reims-go-src + cd reims-go mkdir -p cmd/reims-doctor cat <<'EOF' > cmd/reims-doctor/main.go package main From a31ecdaf8fe3f8ef383a9e2be0b14485e15a62a0 Mon Sep 17 00:00:00 2001 From: bvz rays <1372627285@qq.com> Date: Wed, 2 Dec 2026 14:20:10 +0800 Subject: [PATCH 2/2] ci: skip PR comment when a fork token is read-only --- .github/workflows/pr-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index fd96c22..7c2e9ce 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -76,7 +76,7 @@ jobs: node scripts/build-index.mjs --check $extra --report pr-report.md - name: Post gate report comment on PR - if: always() && hashFiles('pr-report.md') != '' + if: always() && hashFiles('pr-report.md') != '' && github.event.pull_request.head.repo.full_name == github.repository uses: actions/github-script@v7 with: script: |