Skip to content

Commit 0698c1c

Browse files
committed
fix: Trigger workflows on pull_request events
1 parent 0ab1e4c commit 0698c1c

File tree

5 files changed

+54
-10
lines changed

5 files changed

+54
-10
lines changed

.github/workflows/debian.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
name: Debian
22

33
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/debian.yml
7+
- docker/debian/Dockerfile*
8+
- test
49
push:
10+
branches:
11+
- main
512
paths:
613
- .github/workflows/debian.yml
714
- docker/debian/Dockerfile*
@@ -17,7 +24,7 @@ defaults:
1724
shell: bash
1825

1926
env:
20-
PUSH: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
27+
PUSH: ${{ github.event_name == 'push' }}
2128
CONTAINER_REGISTRY: ghcr.io
2229
BUILDKIT_PROGRESS: plain
2330
CONAN_VERSION: 2.19.1
@@ -87,6 +94,7 @@ jobs:
8794
- name: Set up Docker Buildx
8895
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
8996
- name: Login to GitHub Registry
97+
if: ${{ github.event_name == 'push' }}
9098
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
9199
with:
92100
registry: ${{ env.CONTAINER_REGISTRY }}
@@ -161,7 +169,7 @@ jobs:
161169
retention-days: 1
162170

163171
merge:
164-
if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
172+
if: ${{ github.event_name == 'push' }}
165173
strategy:
166174
matrix:
167175
os:
@@ -221,6 +229,7 @@ jobs:
221229
- name: Set up Docker Buildx
222230
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
223231
- name: Login to GitHub Registry
232+
if: ${{ github.event_name == 'push' }}
224233
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
225234
with:
226235
registry: ${{ env.CONTAINER_REGISTRY }}

.github/workflows/gcc.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
name: GCC
22

33
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/gcc.yml
7+
- docker/gcc/Dockerfile*
48
push:
9+
branches:
10+
- main
511
paths:
612
- .github/workflows/gcc.yml
713
- docker/gcc/Dockerfile*
@@ -16,7 +22,7 @@ defaults:
1622
shell: bash
1723

1824
env:
19-
PUSH: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
25+
PUSH: ${{ github.event_name == 'push' }}
2026
CONTAINER_REGISTRY: ghcr.io
2127
BUILDKIT_PROGRESS: plain
2228

@@ -49,6 +55,7 @@ jobs:
4955
- name: Set up Docker Buildx
5056
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
5157
- name: Login to GitHub Registry
58+
if: ${{ github.event_name == 'push' }}
5259
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
5360
with:
5461
registry: ${{ env.CONTAINER_REGISTRY }}
@@ -109,7 +116,7 @@ jobs:
109116
retention-days: 1
110117

111118
merge:
112-
if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
119+
if: ${{ github.event_name == 'push' }}
113120
strategy:
114121
matrix:
115122
os:
@@ -138,6 +145,7 @@ jobs:
138145
- name: Set up Docker Buildx
139146
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
140147
- name: Login to GitHub Registry
148+
if: ${{ github.event_name == 'push' }}
141149
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
142150
with:
143151
registry: ${{ env.CONTAINER_REGISTRY }}

.github/workflows/rhel.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
name: RHEL
22

33
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/rhel.yml
7+
- docker/rhel/Dockerfile
8+
- test
49
push:
10+
branches:
11+
- main
512
paths:
613
- .github/workflows/rhel.yml
714
- docker/rhel/Dockerfile
@@ -17,7 +24,7 @@ defaults:
1724
shell: bash
1825

1926
env:
20-
PUSH: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
27+
PUSH: ${{ github.event_name == 'push' }}
2128
CONTAINER_REGISTRY: ghcr.io
2229
REDHAT_REGISTRY: registry.redhat.io
2330
BUILDKIT_PROGRESS: plain
@@ -66,12 +73,14 @@ jobs:
6673
- name: Set up Docker Buildx
6774
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
6875
- name: Login to GitHub Registry
76+
if: ${{ github.event_name == 'push' }}
6977
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
7078
with:
7179
registry: ${{ env.CONTAINER_REGISTRY }}
7280
username: ${{ github.repository_owner }}
7381
password: ${{ secrets.GITHUB_TOKEN }}
7482
- name: Login to Red Hat Registry
83+
if: ${{ github.event_name == 'push' }}
7584
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
7685
with:
7786
registry: ${{ env.REDHAT_REGISTRY }}
@@ -141,7 +150,7 @@ jobs:
141150
retention-days: 1
142151

143152
merge:
144-
if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
153+
if: ${{ github.event_name == 'push' }}
145154
strategy:
146155
matrix:
147156
os:
@@ -180,6 +189,7 @@ jobs:
180189
- name: Set up Docker Buildx
181190
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
182191
- name: Login to GitHub Registry
192+
if: ${{ github.event_name == 'push' }}
183193
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
184194
with:
185195
registry: ${{ env.CONTAINER_REGISTRY }}

.github/workflows/tools-rippled.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
name: Tools-rippled
22

33
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/tools-rippled.yml
7+
- docker/tools-rippled/Dockerfile
48
push:
9+
branches:
10+
- main
511
paths:
612
- .github/workflows/tools-rippled.yml
713
- docker/tools-rippled/Dockerfile
@@ -16,7 +22,7 @@ defaults:
1622
shell: bash
1723

1824
env:
19-
PUSH: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
25+
PUSH: ${{ github.event_name == 'push' }}
2026
CONTAINER_REGISTRY: ghcr.io
2127
BUILDKIT_PROGRESS: plain
2228
CMAKE_VERSION: 3.31.6
@@ -47,6 +53,7 @@ jobs:
4753
- name: Set up Docker Buildx
4854
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
4955
- name: Login to GitHub Registry
56+
if: ${{ github.event_name == 'push' }}
5057
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
5158
with:
5259
registry: ${{ env.CONTAINER_REGISTRY }}
@@ -115,7 +122,7 @@ jobs:
115122
retention-days: 1
116123

117124
merge:
118-
if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
125+
if: ${{ github.event_name == 'push' }}
119126
strategy:
120127
matrix:
121128
tool:
@@ -138,6 +145,7 @@ jobs:
138145
- name: Set up Docker Buildx
139146
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
140147
- name: Login to GitHub Registry
148+
if: ${{ github.event_name == 'push' }}
141149
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
142150
with:
143151
registry: ${{ env.CONTAINER_REGISTRY }}

.github/workflows/ubuntu.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
name: Ubuntu
22

33
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/ubuntu.yml
7+
- docker/ubuntu/Dockerfile
8+
- test
49
push:
10+
branches:
11+
- main
512
paths:
613
- .github/workflows/ubuntu.yml
714
- docker/ubuntu/Dockerfile
@@ -17,7 +24,7 @@ defaults:
1724
shell: bash
1825

1926
env:
20-
PUSH: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
27+
PUSH: ${{ github.event_name == 'push' }}
2128
CONTAINER_REGISTRY: ghcr.io
2229
BUILDKIT_PROGRESS: plain
2330
CONAN_VERSION: 2.19.1
@@ -70,6 +77,7 @@ jobs:
7077
- name: Set up Docker Buildx
7178
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
7279
- name: Login to GitHub Registry
80+
if: ${{ github.event_name == 'push' }}
7381
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
7482
with:
7583
registry: ${{ env.CONTAINER_REGISTRY }}
@@ -140,7 +148,7 @@ jobs:
140148
retention-days: 1
141149

142150
merge:
143-
if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
151+
if: ${{ github.event_name == 'push' }}
144152
strategy:
145153
matrix:
146154
os:
@@ -182,6 +190,7 @@ jobs:
182190
- name: Set up Docker Buildx
183191
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
184192
- name: Login to GitHub Registry
193+
if: ${{ github.event_name == 'push' }}
185194
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
186195
with:
187196
registry: ${{ env.CONTAINER_REGISTRY }}

0 commit comments

Comments
 (0)