From 737135bba7af6738796b3f683ea359adca4b0cfa Mon Sep 17 00:00:00 2001 From: An Phi Date: Tue, 21 Nov 2023 11:21:16 -0500 Subject: [PATCH] restrict certain workflows to only run in main repo (#784) --- .github/workflows/build-showcases-index.yml | 7 ++++++- .github/workflows/build-website.yml | 3 ++- .github/workflows/publish-website.yml | 7 ++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-showcases-index.yml b/.github/workflows/build-showcases-index.yml index 8ea3fda90..6e08f4c43 100644 --- a/.github/workflows/build-showcases-index.yml +++ b/.github/workflows/build-showcases-index.yml @@ -13,7 +13,12 @@ env: REPO_NAME: ${{ github.event.repository.name }} jobs: - website-build: + build-index: + name: Build Showcase Index + # There is currently no way to limit workflow dispatch to only allow default branch + # so we need to restrict it here + # See https://github.community/t/limit-branch-for-workflow-dispatch/122099 + if: github.ref == 'refs/heads/master' && github.repository == 'finos/legend' runs-on: ubuntu-latest steps: - name: Checkout Repo diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml index f3ecdbefe..3546c2da4 100644 --- a/.github/workflows/build-website.yml +++ b/.github/workflows/build-website.yml @@ -6,7 +6,8 @@ on: - "**" jobs: - website-build: + build-website: + name: Build Website runs-on: ubuntu-latest steps: - name: Checkout Repo diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml index 3ce66521a..f3f992995 100644 --- a/.github/workflows/publish-website.yml +++ b/.github/workflows/publish-website.yml @@ -11,7 +11,12 @@ env: REPO_NAME: ${{ github.event.repository.name }} jobs: - website-build: + publish-website: + name: Publish Website + # There is currently no way to limit workflow dispatch to only allow default branch + # so we need to restrict it here + # See https://github.community/t/limit-branch-for-workflow-dispatch/122099 + if: github.ref == 'refs/heads/master' && github.repository == 'finos/legend' runs-on: ubuntu-latest steps: - name: Checkout Repo