From 6410b6d8f4b3dcb38cd817ce7133356371a38e54 Mon Sep 17 00:00:00 2001 From: Hafiz Adewuyi Date: Wed, 7 Aug 2024 15:47:26 +0300 Subject: [PATCH] Trigger workflow jobs only on the main organization repo. (#86) --- .github/workflows/api-deploy-staging.yml | 2 ++ .github/workflows/deploy-dotnet-service-ec2.yml | 1 - .github/workflows/website-deploy-staging.yml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/api-deploy-staging.yml b/.github/workflows/api-deploy-staging.yml index 9c665aa..1448cf8 100644 --- a/.github/workflows/api-deploy-staging.yml +++ b/.github/workflows/api-deploy-staging.yml @@ -7,6 +7,7 @@ on: jobs: fetch-vars: + if: github.repository_owner == 'Yorubaname' runs-on: ubuntu-latest environment: staging outputs: @@ -16,6 +17,7 @@ jobs: - run: echo "Exposing vars to reusable workflow." deploy: + if: github.repository_owner == 'Yorubaname' needs: fetch-vars uses: ./.github/workflows/deploy-dotnet-service-ec2.yml secrets: inherit diff --git a/.github/workflows/deploy-dotnet-service-ec2.yml b/.github/workflows/deploy-dotnet-service-ec2.yml index bc18e19..34a5909 100644 --- a/.github/workflows/deploy-dotnet-service-ec2.yml +++ b/.github/workflows/deploy-dotnet-service-ec2.yml @@ -21,7 +21,6 @@ on: jobs: deploy: - if: github.repository_owner == 'Yorubaname' runs-on: ubuntu-latest environment: ${{ inputs.environment }} diff --git a/.github/workflows/website-deploy-staging.yml b/.github/workflows/website-deploy-staging.yml index 09a80b9..4744a4a 100644 --- a/.github/workflows/website-deploy-staging.yml +++ b/.github/workflows/website-deploy-staging.yml @@ -7,6 +7,7 @@ on: jobs: fetch-vars: + if: github.repository_owner == 'Yorubaname' runs-on: ubuntu-latest environment: staging outputs: @@ -16,6 +17,7 @@ jobs: - run: echo "Exposing vars to reusable workflow." deploy: + if: github.repository_owner == 'Yorubaname' needs: fetch-vars uses: ./.github/workflows/deploy-dotnet-service-ec2.yml secrets: inherit