Skip to content

Commit 1c54ad4

Browse files
committed
ci: Enhance GitHub Actions job conditions
* Modify `if` expressions to check if the github.event_name is from a pull request. * Prevent some jobs from running on draft requests.
1 parent 7ed63c3 commit 1c54ad4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/test-build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: [pull_request]
33
jobs:
44
scarthgap-repo:
55
runs-on: [self-hosted, builder]
6-
if: "!contains(github.event.head_commit.message, 'ci skip')"
6+
if: "!contains(github.event.head_commit.message, 'ci skip') && github.event_name == 'pull_request'"
77
steps:
88
- uses: actions/checkout@v3
99
- uses: ./.github/actions/s3-configure
@@ -27,7 +27,7 @@ jobs:
2727
wpe_vers: ['2_46']
2828
yocto_rel: ['scarthgap']
2929
runs-on: [self-hosted, builder]
30-
if: "!contains(github.event.head_commit.message, 'ci skip')"
30+
if: "!contains(github.event.head_commit.message, 'ci skip') && github.event_name == 'pull_request'"
3131
needs: scarthgap-repo
3232
steps:
3333
- uses: actions/checkout@v3
@@ -72,7 +72,7 @@ jobs:
7272
yocto_rel: ['scarthgap']
7373
continue-on-error: true
7474
runs-on: [self-hosted, builder]
75-
if: "!contains(github.event.head_commit.message, 'ci skip')"
75+
if: "!contains(github.event.head_commit.message, 'ci skip') && github.event_name == 'pull_request' && !github.event.pull_request.draft"
7676
needs: scarthgap-repo
7777
steps:
7878
- uses: actions/checkout@v3
@@ -92,7 +92,7 @@ jobs:
9292
yocto_rel: ['scarthgap']
9393
continue-on-error: true
9494
runs-on: [self-hosted, builder]
95-
if: "!contains(github.event.head_commit.message, 'ci skip')"
95+
if: "!contains(github.event.head_commit.message, 'ci skip') && github.event_name == 'pull_request' && !github.event.pull_request.draft"
9696
needs: scarthgap-repo
9797
steps:
9898
- uses: actions/checkout@v3

0 commit comments

Comments
 (0)