ci: 限制工作流仅在主仓库执行
为 npm 发布、文档构建与部署以及创建发布的工作流添加条件执行。 现在这些工作流仅会在 'anghunk/cwd' 仓库中运行,防止在复刻仓库上意外触发。
This commit is contained in:
1
.github/workflows/create_release.yml
vendored
1
.github/workflows/create_release.yml
vendored
@@ -8,6 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
check-release:
|
||||
if: github.repository == 'anghunk/cwd'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
1
.github/workflows/docs.yml
vendored
1
.github/workflows/docs.yml
vendored
@@ -2,6 +2,7 @@ name: Build and Deploy Docs
|
||||
on: [push]
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
if: github.repository == 'anghunk/cwd'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
1
.github/workflows/npm_publish.yml
vendored
1
.github/workflows/npm_publish.yml
vendored
@@ -8,6 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: github.repository == 'anghunk/cwd'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
|
||||
Reference in New Issue
Block a user