From e4dceb6325706eddfefa98020d8ae10edb6a744a Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Fri, 15 Dec 2023 20:32:18 +0800 Subject: [PATCH] ci: add conditional restrictions (#264) --- .github/workflows/build.yml | 1 + .github/workflows/preview-build.yml | 1 + .github/workflows/preview-deploy.yml | 4 ++-- .github/workflows/preview-start.yml | 1 + .github/workflows/release-cli.yml | 1 + .github/workflows/release.yml | 1 + 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b09413..9a3de78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,7 @@ on: jobs: build-and-deploy: runs-on: ubuntu-latest + if: github.repository == 'doocs/md' steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index a13e005..fffd689 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -7,6 +7,7 @@ on: jobs: build-preview: runs-on: ubuntu-latest + if: github.repository == 'doocs/md' steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml index e9f67ec..08c4e7a 100644 --- a/.github/workflows/preview-deploy.yml +++ b/.github/workflows/preview-deploy.yml @@ -9,7 +9,7 @@ on: jobs: success: runs-on: ubuntu-latest - if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' + if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' && github.repository == 'doocs/md' steps: - name: Download PR artifact uses: dawidd6/action-download-artifact@v2 @@ -63,7 +63,7 @@ jobs: failed: runs-on: ubuntu-latest - if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' + if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' && github.repository == 'doocs/md' steps: - name: Download PR artifact uses: dawidd6/action-download-artifact@v2 diff --git a/.github/workflows/preview-start.yml b/.github/workflows/preview-start.yml index 9f191c5..ac63b18 100644 --- a/.github/workflows/preview-start.yml +++ b/.github/workflows/preview-start.yml @@ -5,6 +5,7 @@ on: pull_request_target jobs: preview: runs-on: ubuntu-latest + if: github.repository == 'doocs/md' steps: - name: Create uses: actions-cool/maintain-one-comment@v3 diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index bd3de35..07407b4 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -8,6 +8,7 @@ on: jobs: build: runs-on: ubuntu-latest + if: github.repository == 'doocs/md' steps: - uses: actions/checkout@v3 # Setup .npmrc file to publish to npm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8faa4d3..342bbbe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ jobs: build: name: Create Release runs-on: ubuntu-latest + if: github.repository == 'doocs/md' steps: - name: Checkout code uses: actions/checkout@v3