Skip to content

Commit 2428552

Browse files
authored
ci(template): Skip various jobs/steps if coming from a fork (#582)
* ci(template): Skip various jobs/steps if coming from a fork * ci: Bump stackabletech/actions to v0.13.1 * ci(template): Bump stackabletech/actions to v0.13.1
1 parent 0a53fae commit 2428552

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed

.github/workflows/pr_pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
persist-credentials: false
2020
fetch-depth: 0
21-
- uses: stackabletech/actions/run-pre-commit@c34dbb4f27b274736c7d2edc6f6f30a03d03edf5 # v0.12.2
21+
- uses: stackabletech/actions/run-pre-commit@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
2222
with:
2323
python-version: ${{ env.PYTHON_VERSION }}
2424
hadolint: ${{ env.HADOLINT_VERSION }}

template/.github/workflows/build.yaml.j2

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
- name: Check for changed files
5050
id: check
51-
uses: stackabletech/actions/detect-changes@babe44d7b1db87f8e7731c011151d22a8a374191 # v0.12.0
51+
uses: stackabletech/actions/detect-changes@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
5252
with:
5353
patterns: |
5454
- '.github/workflows/build.yaml'
@@ -166,15 +166,16 @@ jobs:
166166

167167
- name: Build Container Image
168168
id: build
169-
uses: stackabletech/actions/build-container-image@babe44d7b1db87f8e7731c011151d22a8a374191 # v0.12.0
169+
uses: stackabletech/actions/build-container-image@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
170170
with:
171171
image-name: ${{ env.OPERATOR_NAME }}
172172
image-index-manifest-tag: ${{ steps.version.outputs.OPERATOR_VERSION }}
173173
build-arguments: VERSION=${{ steps.version.outputs.OPERATOR_VERSION }}
174174
container-file: docker/Dockerfile
175175

176176
- name: Publish Container Image
177-
uses: stackabletech/actions/publish-image@babe44d7b1db87f8e7731c011151d22a8a374191 # v0.12.0
177+
if: ${{ !github.event.pull_request.head.repo.fork }}
178+
uses: stackabletech/actions/publish-image@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
178179
with:
179180
image-registry-uri: oci.stackable.tech
180181
image-registry-username: robot$sdp+github-action-build
@@ -185,7 +186,10 @@ jobs:
185186

186187
publish-index-manifest:
187188
name: Publish/Sign ${{ needs.build-container-image.outputs.operator-version }} Index
188-
if: (github.event_name != 'merge_group') && needs.detect-changes.outputs.detected == 'true'
189+
if: |
190+
(github.event_name != 'merge_group')
191+
&& needs.detect-changes.outputs.detected == 'true'
192+
&& !github.event.pull_request.head.repo.fork
189193
needs:
190194
- detect-changes
191195
- build-container-image
@@ -199,7 +203,7 @@ jobs:
199203
persist-credentials: false
200204

201205
- name: Publish and Sign Image Index
202-
uses: stackabletech/actions/publish-image-index-manifest@babe44d7b1db87f8e7731c011151d22a8a374191 # v0.12.0
206+
uses: stackabletech/actions/publish-image-index-manifest@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
203207
with:
204208
image-registry-uri: oci.stackable.tech
205209
image-registry-username: robot$sdp+github-action-build
@@ -209,7 +213,9 @@ jobs:
209213

210214
publish-helm-chart:
211215
name: Package/Publish ${{ needs.build-container-image.outputs.operator-version }} Helm Chart
212-
if: (github.event_name != 'merge_group') && needs.detect-changes.outputs.detected == 'true'
216+
if: |
217+
(github.event_name != 'merge_group')
218+
&& needs.detect-changes.outputs.detected == 'true'
213219
needs:
214220
- detect-changes
215221
- build-container-image
@@ -224,7 +230,7 @@ jobs:
224230
submodules: recursive
225231

226232
- name: Package, Publish, and Sign Helm Chart
227-
uses: stackabletech/actions/publish-helm-chart@babe44d7b1db87f8e7731c011151d22a8a374191 # v0.12.0
233+
uses: stackabletech/actions/publish-helm-chart@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
228234
with:
229235
chart-registry-uri: oci.stackable.tech
230236
chart-registry-username: robot$sdp-charts+github-action-build
@@ -233,10 +239,14 @@ jobs:
233239
chart-directory: deploy/helm/${{ env.OPERATOR_NAME }}
234240
chart-version: ${{ needs.build-container-image.outputs.operator-version }}
235241
app-version: ${{ needs.build-container-image.outputs.operator-version }}
242+
publish-and-sign: ${{ !github.event.pull_request.head.repo.fork }}
236243

237244
openshift-preflight-check:
238245
name: Run OpenShift Preflight Check for ${{ needs.build-container-image.outputs.operator-version }}-${{ matrix.arch }}
239-
if: (github.event_name != 'merge_group') && needs.detect-changes.outputs.detected == 'true'
246+
if: |
247+
(github.event_name != 'merge_group')
248+
&& needs.detect-changes.outputs.detected == 'true'
249+
&& !github.event.pull_request.head.repo.fork
240250
needs:
241251
- detect-changes
242252
- build-container-image
@@ -250,7 +260,7 @@ jobs:
250260
runs-on: ubuntu-latest
251261
steps:
252262
- name: Run OpenShift Preflight Check
253-
uses: stackabletech/actions/run-openshift-preflight@babe44d7b1db87f8e7731c011151d22a8a374191 # v0.12.0
263+
uses: stackabletech/actions/run-openshift-preflight@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
254264
with:
255265
image-index-uri: oci.stackable.tech/sdp/${{ env.OPERATOR_NAME }}:${{ needs.build-container-image.outputs.operator-version }}
256266
image-architecture: ${{ matrix.arch }}
@@ -272,7 +282,11 @@ jobs:
272282

273283
notify:
274284
name: Failure Notification
275-
if: (failure() || github.run_attempt > 1) && github.event_name != 'merge_group' && needs.detect-changes.outputs.detected == 'true'
285+
if: |
286+
(failure() || github.run_attempt > 1)
287+
&& github.event_name != 'merge_group'
288+
&& needs.detect-changes.outputs.detected == 'true'
289+
&& !github.event.pull_request.head.repo.fork
276290
needs:
277291
- detect-changes
278292
- build-container-image
@@ -286,7 +300,7 @@ jobs:
286300
persist-credentials: false
287301

288302
- name: Send Notification
289-
uses: stackabletech/actions/send-slack-notification@babe44d7b1db87f8e7731c011151d22a8a374191 # v0.12.0
303+
uses: stackabletech/actions/send-slack-notification@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
290304
with:
291305
publish-helm-chart-result: ${{ needs.publish-helm-chart.result }}
292306
publish-manifests-result: ${{ needs.publish-index-manifest.result }}

template/.github/workflows/integration-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
# TODO: Enable the scheduled runs which hard-code what profile to use
4242
- name: Run Integration Test
4343
id: test
44-
uses: stackabletech/actions/run-integration-test@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
44+
uses: stackabletech/actions/run-integration-test@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
4545
with:
4646
replicated-api-token: ${{ secrets.REPLICATED_API_TOKEN }}
4747
test-mode-input: ${{ inputs.test-mode-input }}
@@ -51,7 +51,7 @@ jobs:
5151

5252
- name: Send Notification
5353
if: ${{ failure() || github.run_attempt > 1 }}
54-
uses: stackabletech/actions/send-slack-notification@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
54+
uses: stackabletech/actions/send-slack-notification@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
5555
with:
5656
slack-token: ${{ secrets.SLACK_INTEGRATION_TEST_TOKEN }}
5757
failed-tests: ${{ steps.test.outputs.failed-tests }}

template/.github/workflows/pr_pre-commit.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
persist-credentials: false
2828
submodules: recursive
2929
fetch-depth: 0
30-
- uses: stackabletech/actions/run-pre-commit@29bea1b451c0c2e994bd495969286f95bf49ed6a # v0.11.0
30+
- uses: stackabletech/actions/run-pre-commit@9848c5593dff4793aacba240116a648c02f20fa4 # v0.13.1
3131
with:
3232
python-version: ${{ env.PYTHON_VERSION }}
3333
rust: ${{ env.RUST_TOOLCHAIN_VERSION }}

0 commit comments

Comments
 (0)