Skip to content

Commit 9db61ee

Browse files
committed
ci: Skip jobs on forks which would fail anyway
1 parent a439139 commit 9db61ee

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/debian-build.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ jobs:
192192
run-lrc: true
193193

194194
- name: Prepare deb and sources for upload
195-
if: steps.restore-cache.outputs.cache-hit != 'true'
195+
if: >
196+
steps.restore-cache.outputs.cache-hit != 'true' &&
197+
# Skip if the PR is from a fork, as we don't have the permission to
198+
# upload to the OCI registry.
199+
github.event.pull_request.head.repo.full_name == github.repository
196200
run: |
197201
set -euo pipefail
198202
set -x
@@ -220,6 +224,9 @@ jobs:
220224
echo "PKG_TARBALL=${PKG_TARBALL}" >> ${GITHUB_ENV}
221225
222226
- name: Upload deb and sources as OCI artifacts
227+
# Skip if the PR is from a fork, as we don't have the permission to
228+
# upload to the OCI registry.
229+
if: github.event.pull_request.head.repo.full_name == github.repository
223230
run: |
224231
set -euo pipefail
225232
set -x

.github/workflows/e2e-tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ concurrency:
5959
jobs:
6060
compute-hash:
6161
name: Compute hash of build-relevant files
62+
# Skip this job (and the provision-and-run job which depends on it) if the
63+
# PR is from a fork, as we won't be able to pass the Debian package via OCI
64+
# artifacts in the provision-and-run workflow.
65+
if: github.event.pull_request.head.repo.full_name == github.repository
6266
runs-on: ubuntu-latest
6367
outputs:
6468
files-hash: ${{ steps.hash.outputs.hash }}

0 commit comments

Comments
 (0)