From bac9c4c0f77875baf1b520f4f2a1fee068486372 Mon Sep 17 00:00:00 2001 From: muhammad adil ghaffar Date: Mon, 11 Mar 2024 13:03:49 +0200 Subject: [PATCH] Making workflows not run on forks. Signed-off-by: muhammad adil ghaffar --- .github/workflows/build-test-lint.yml | 2 +- .github/workflows/image-push-master.yml | 6 ++++++ .github/workflows/image-push-release.yml | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 1fe616f07..4a337aa70 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -60,7 +60,7 @@ jobs: - name: Go test with coverage run: make test-coverage - + - name: Coveralls uses: coverallsapp/github-action@1.1.3 with: diff --git a/.github/workflows/image-push-master.yml b/.github/workflows/image-push-master.yml index 16c0e4429..e186bc2b5 100644 --- a/.github/workflows/image-push-master.yml +++ b/.github/workflows/image-push-master.yml @@ -3,8 +3,11 @@ on: push: branches: - master +env: + image-push-owner: 'k8snetworkplumbingwg' jobs: build-and-push-amd64-device-plugin: + if: ${{ github.repository_owner == env.image-push-owner }} name: Image push AMD64 runs-on: ubuntu-20.04 env: @@ -35,6 +38,7 @@ jobs: file: images/Dockerfile build-and-push-arm64-device-plugin: + if: ${{ github.repository_owner == env.image-push-owner }} name: Image push ARM64 runs-on: ubuntu-20.04 env: @@ -67,6 +71,7 @@ jobs: file: images/Dockerfile.arm64 build-and-push-ppc64le-device-plugin: + if: ${{ github.repository_owner == env.image-push-owner }} name: Image push ppc64le runs-on: ubuntu-20.04 env: @@ -99,6 +104,7 @@ jobs: file: images/Dockerfile.ppc64le push-manifest: + if: ${{ github.repository_owner == env.image-push-owner }} runs-on: ubuntu-20.04 env: IMAGE_NAME: ghcr.io/${{ github.repository }} diff --git a/.github/workflows/image-push-release.yml b/.github/workflows/image-push-release.yml index f1d0c6078..39f557f43 100644 --- a/.github/workflows/image-push-release.yml +++ b/.github/workflows/image-push-release.yml @@ -3,8 +3,11 @@ on: push: tags: - v* +env: + image-push-owner: 'k8snetworkplumbingwg' jobs: build-and-push-amd64-device-plugin: + if: ${{ github.repository_owner == env.image-push-owner }} name: Image push AMD64 runs-on: ubuntu-20.04 env: @@ -44,6 +47,7 @@ jobs: file: images/Dockerfile build-and-push-arm64-device-plugin: + if: ${{ github.repository_owner == env.image-push-owner }} name: Image push ARM64 runs-on: ubuntu-20.04 env: @@ -87,6 +91,7 @@ jobs: file: images/Dockerfile.arm64 build-and-push-ppc64le-device-plugin: + if: ${{ github.repository_owner == env.image-push-owner }} name: Image push ppc64le runs-on: ubuntu-20.04 env: @@ -129,6 +134,7 @@ jobs: file: images/Dockerfile.ppc64le push-manifest: + if: ${{ github.repository_owner == env.image-push-owner }} runs-on: ubuntu-20.04 env: IMAGE_NAME: ghcr.io/${{ github.repository }}