From 6a0189764081cc870200a31018c59fc12e07d66d Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Mon, 23 May 2022 19:21:30 -0700 Subject: [PATCH] Don't run some workflows on forks --- .github/sync.yml | 17 ----------------- .github/workflows/dockerhub-description.yml | 1 + .github/workflows/fossa.yml | 1 + .github/workflows/notifications.yml | 2 +- .github/workflows/sync.yml | 17 ++--------------- 5 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 .github/sync.yml diff --git a/.github/sync.yml b/.github/sync.yml deleted file mode 100644 index 5d7e645acd..0000000000 --- a/.github/sync.yml +++ /dev/null @@ -1,17 +0,0 @@ -nginxinc/nginx-ingress-operator: - - source: deployments/common/crds/appprotect.f5.com_aplogconfs.yaml - dest: config/crd/kic/appprotect.f5.com_aplogconfs.yaml - - source: deployments/common/crds/appprotect.f5.com_appolicies.yaml - dest: config/crd/kic/appprotect.f5.com_appolicies.yaml - - source: deployments/common/crds/appprotect.f5.com_apusersigs.yaml - dest: config/crd/kic/appprotect.f5.com_apusersigs.yaml - - source: deployments/common/crds/k8s.nginx.org_globalconfigurations.yaml - dest: config/crd/kic/k8s.nginx.org_globalconfigurations.yaml - - source: deployments/common/crds/k8s.nginx.org_policies.yaml - dest: config/crd/kic/k8s.nginx.org_policies.yaml - - source: deployments/common/crds/k8s.nginx.org_transportservers.yaml - dest: config/crd/kic/k8s.nginx.org_transportservers.yaml - - source: deployments/common/crds/k8s.nginx.org_virtualserverroutes.yaml - dest: config/crd/kic/k8s.nginx.org_virtualserverroutes.yaml - - source: deployments/common/crds/k8s.nginx.org_virtualservers.yaml - dest: config/crd/kic/k8s.nginx.org_virtualservers.yaml diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/dockerhub-description.yml index 66f29c6dbe..111dadfbae 100644 --- a/.github/workflows/dockerhub-description.yml +++ b/.github/workflows/dockerhub-description.yml @@ -15,6 +15,7 @@ concurrency: jobs: dockerHubDescription: runs-on: ubuntu-20.04 + if: ${{ github.event.repository.fork == false }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index 9ec7a19581..f9b20e9042 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -18,6 +18,7 @@ jobs: scan: name: Fossa runs-on: ubuntu-20.04 + if: ${{ github.event.repository.fork == false }} steps: - name: Checkout Repository uses: actions/checkout@v3 diff --git a/.github/workflows/notifications.yml b/.github/workflows/notifications.yml index 09b20bb16f..4941085ccc 100644 --- a/.github/workflows/notifications.yml +++ b/.github/workflows/notifications.yml @@ -15,7 +15,7 @@ on: jobs: on-failure: runs-on: ubuntu-20.04 - if: ${{ github.event.workflow_run.conclusion == 'failure' }} + if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.repository.fork == false }} steps: - name: Data uses: actions/github-script@v6 diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index e953453c48..702dbdffed 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -16,6 +16,7 @@ jobs: # This job sync this repo to our internal repo repo-sync: runs-on: ubuntu-20.04 + if: ${{ github.event.repository.fork == false }} steps: - name: Repo Sync uses: wei/git-sync@v3 @@ -26,21 +27,6 @@ jobs: destination_branch: "main" ssh_private_key: ${{ secrets.SYNC_SSH_PRIVATE_KEY }} - # This job open a PR to sync the generated CRD files across to nginx-ingress-operator - # (see .github/sync.yml for config details) - crds-sync: - runs-on: ubuntu-20.04 - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - name: Run CRD File Sync - uses: BetaHuhn/repo-file-sync-action@v1 - with: - GH_PAT: ${{ secrets.NGINX_PAT }} - ASSIGNEES: "nginxinc/kic" - PR_LABELS: chore - COMMIT_EACH_FILE: false - # This job sync the labels across the various repos labels-sync: strategy: @@ -55,6 +41,7 @@ jobs: - nginxinc/nginx-asg-sync - nginxinc/nginx-ns1-gslb runs-on: ubuntu-20.04 + if: ${{ github.event.repository.fork == false }} steps: - name: Checkout uses: actions/checkout@v3