ci: 限制工作流仅在主仓库执行

为 npm 发布、文档构建与部署以及创建发布的工作流添加条件执行。
现在这些工作流仅会在 'anghunk/cwd' 仓库中运行,防止在复刻仓库上意外触发。
This commit is contained in:
anghunk
2026-02-04 14:02:58 +08:00
parent b8550848d7
commit 615589f86b
3 changed files with 3 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ on:
jobs: jobs:
check-release: check-release:
if: github.repository == 'anghunk/cwd'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code

View File

@@ -2,6 +2,7 @@ name: Build and Deploy Docs
on: [push] on: [push]
jobs: jobs:
build-and-deploy: build-and-deploy:
if: github.repository == 'anghunk/cwd'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout

View File

@@ -8,6 +8,7 @@ on:
jobs: jobs:
publish: publish:
if: github.repository == 'anghunk/cwd'
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions: