ci: add conditional restrictions (#264)

This commit is contained in:
thinkasany 2023-12-15 20:32:18 +08:00 committed by GitHub
parent c2e5bec81e
commit e4dceb6325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 2 deletions

View File

@ -8,6 +8,7 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3

View File

@ -7,6 +7,7 @@ on:
jobs: jobs:
build-preview: build-preview:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -9,7 +9,7 @@ on:
jobs: jobs:
success: success:
runs-on: ubuntu-latest 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: steps:
- name: Download PR artifact - name: Download PR artifact
uses: dawidd6/action-download-artifact@v2 uses: dawidd6/action-download-artifact@v2
@ -63,7 +63,7 @@ jobs:
failed: failed:
runs-on: ubuntu-latest 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: steps:
- name: Download PR artifact - name: Download PR artifact
uses: dawidd6/action-download-artifact@v2 uses: dawidd6/action-download-artifact@v2

View File

@ -5,6 +5,7 @@ on: pull_request_target
jobs: jobs:
preview: preview:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps: steps:
- name: Create - name: Create
uses: actions-cool/maintain-one-comment@v3 uses: actions-cool/maintain-one-comment@v3

View File

@ -8,6 +8,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
# Setup .npmrc file to publish to npm # Setup .npmrc file to publish to npm

View File

@ -9,6 +9,7 @@ jobs:
build: build:
name: Create Release name: Create Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3