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:
|
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
|
||||||
|
|||||||
1
.github/workflows/docs.yml
vendored
1
.github/workflows/docs.yml
vendored
@@ -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
|
||||||
|
|||||||
1
.github/workflows/npm_publish.yml
vendored
1
.github/workflows/npm_publish.yml
vendored
@@ -8,6 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
|
if: github.repository == 'anghunk/cwd'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
Reference in New Issue
Block a user