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:
build-and-deploy:
runs-on: ubuntu-latest
if: github.repository == 'doocs/md'
steps:
- name: Checkout
uses: actions/checkout@v3

View File

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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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