Skip to content

Commit a2c77ac

Browse files
authored
Merge pull request #1168 from PHPCSStandards/feature/ghactions-minor-tweak
GH Actions: improve "don't run on forks" condition
2 parents dccc53f + 21b00b7 commit a2c77ac

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/happy-new-year.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
update-year-in-test:
2929
runs-on: ubuntu-latest
3030
# Don't run the cron job on forks.
31-
if: ${{ github.event_name != 'schedule' || github.repository == 'PHPCSStandards/PHP_CodeSniffer' }}
31+
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
3232

3333
name: "Happy New Year"
3434
steps:

.github/workflows/validate.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323

2424
# Don't run the cronjob in this workflow on forks.
25-
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
25+
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
2626

2727
steps:
2828
- name: Checkout code
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-latest
4949

5050
# Don't run the cronjob in this workflow on forks.
51-
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
51+
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
5252

5353
steps:
5454
- name: Checkout code
@@ -92,7 +92,7 @@ jobs:
9292
runs-on: ubuntu-latest
9393

9494
# Don't run the cronjob in this workflow on forks.
95-
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
95+
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
9696

9797
env:
9898
XMLLINT_INDENT: ' '
@@ -131,7 +131,7 @@ jobs:
131131
yamllint:
132132
name: 'Lint Yaml'
133133
# Don't run the cronjob in this workflow on forks.
134-
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
134+
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
135135

136136
uses: PHPCSStandards/.github/.github/workflows/reusable-yamllint.yml@main
137137
with:
@@ -140,13 +140,13 @@ jobs:
140140
markdownlint:
141141
name: 'Lint Markdown'
142142
# Don't run the cronjob in this workflow on forks.
143-
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
143+
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
144144

145145
uses: PHPCSStandards/.github/.github/workflows/reusable-markdownlint.yml@main
146146

147147
remark:
148148
name: 'QA Markdown'
149149
# Don't run the cronjob in this workflow on forks.
150-
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
150+
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
151151

152152
uses: PHPCSStandards/.github/.github/workflows/reusable-remark.yml@main

0 commit comments

Comments
 (0)