Skip to content

Commit da627ca

Browse files
andykenwardCopilot
andcommitted
ci: deploy skip on fork
Co-authored-by: Copilot <copilot@github.com>
1 parent f56ee71 commit da627ca

1 file changed

Lines changed: 15 additions & 19 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,26 @@
22

33
name: deploy
44
on:
5-
workflow_run:
6-
workflows:
7-
- test
8-
types:
9-
- completed
5+
pull_request:
6+
branches:
7+
- main
108

119
concurrency:
1210
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1311

1412
jobs:
13+
fork:
14+
if: ${{ github.event.pull_request.head.repo.fork }}
15+
permissions:
16+
contents: read
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 1
19+
steps:
20+
- name: Fork PR notice
21+
run: echo 'Fork pull request detected; skipping deploy job that requires repository secrets.'
22+
1523
deploy:
16-
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch != 'main' }}
24+
if: ${{ !github.event.pull_request.head.repo.fork }}
1725
permissions:
1826
actions: read
1927
contents: read
@@ -22,19 +30,7 @@ jobs:
2230
runs-on: ubuntu-latest
2331
timeout-minutes: 5
2432
steps:
25-
- if: github.event_name == 'workflow_run'
26-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
27-
with:
28-
repository: ${{ github.event.workflow_run.head_repository.full_name }}
29-
ref: ${{ github.event.workflow_run.head_sha }}
30-
- if: github.event_name != 'workflow_run'
31-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
32-
- name: Get PR number
33-
run: |
34-
echo "PR Number: ${{ github.event.number }}"
35-
- name: Get PR number other
36-
run: |
37-
echo "PR Number: ${{ github.event.pull_request.number }}"
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
3834
- id: 'cloudflare-pages'
3935
uses: ./
4036
with:

0 commit comments

Comments
 (0)