From 3571ba8ced72ca6a07f0f7b18bee606c5e4654f9 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Mon, 2 Feb 2026 22:35:15 +0800 Subject: [PATCH] =?UTF-8?q?chore(workflow):=20=E6=9B=B4=E6=96=B0=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E9=85=8D=E7=BD=AE=E4=BB=A5=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=B8=E5=8F=AF=E8=AF=81=E5=90=88=E8=A7=84=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 auto-tag 工作流触发器从 "CI - Build & Test" 到 "License Compliance (Feluda)" - 移除 license-compliance 工作流中的依赖和权限设置 - 将 license-compliance 工作流的触发方式改为 workflow_run - 调整 ci 工作流中的内容权限从 write 改为 read - 在 license-compliance 工作流中添加分支和提交消息条件检查 --- .github/workflows/auto-tag.yml | 10 ++-------- .github/workflows/ci.yml | 2 +- .github/workflows/license-compliance.yml | 16 +++++++++------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 0795fea..8431ab5 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -2,7 +2,7 @@ name: Auto Increment Version and Tag on: workflow_run: - workflows: ["CI - Build & Test"] + workflows: ["License Compliance (Feluda)"] types: - completed @@ -54,10 +54,4 @@ jobs: fi git tag -a "$TAG" -m "Auto tag $TAG" - git push "https://x-access-token:${PAT}@github.com/${{ github.repository }}.git" "$TAG" - license-compliance: - needs: auto-tag - if: needs.auto-tag.outputs.tagged == 'true' - uses: ./.github/workflows/license-compliance.yml - permissions: - contents: read \ No newline at end of file + git push "https://x-access-token:${PAT}@github.com/${{ github.repository }}.git" "$TAG" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7424399..d576c2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: branches: [ main, master ] permissions: - contents: write + contents: read security-events: write jobs: diff --git a/.github/workflows/license-compliance.yml b/.github/workflows/license-compliance.yml index 9370c6f..3548a11 100644 --- a/.github/workflows/license-compliance.yml +++ b/.github/workflows/license-compliance.yml @@ -1,20 +1,22 @@ name: License Compliance (Feluda) on: - workflow_call: - inputs: - upload-artifacts: - required: false - type: boolean + workflow_run: + workflows: ["CI - Build & Test"] + types: + - completed default: true permissions: - contents: read + contents: write jobs: compliance: runs-on: ubuntu-latest - + if: > + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.head_branch == 'main'&& + contains(github.event.workflow_run.head_commit.message, '[release ci]') steps: - name: Checkout repository uses: actions/checkout@v4