From 9f87f18a14db84f289f2d314383d7ea4712064ff Mon Sep 17 00:00:00 2001 From: Julien Erard Date: Wed, 18 Oct 2023 15:29:56 -0700 Subject: [PATCH] chore(install): fail any e2e tests when not running from the source repo --- .github/workflows/local-repo-pr.yml | 2 +- .github/workflows/validation.yml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/local-repo-pr.yml b/.github/workflows/local-repo-pr.yml index 1208063da..9553eb84e 100644 --- a/.github/workflows/local-repo-pr.yml +++ b/.github/workflows/local-repo-pr.yml @@ -9,8 +9,8 @@ jobs: limit_main_pr: runs-on: ubuntu-latest steps: - # 1) Check for all incoming changes to files under `recipes` directory - name: Ensure no fork repo + if: ${{ github.event_name == 'pull_request' }} run: | SOURCE_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}) REMOTE_NAME=$(echo ${{ github.event.pull_request.base.repo.full_name }}) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index a31df91a6..3d3189561 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -60,6 +60,16 @@ jobs: with: fetch-depth: 0 + - name: Ensure no fork repo + if: ${{ github.event_name == 'pull_request' }} + run: | + SOURCE_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}) + REMOTE_NAME=$(echo ${{ github.event.pull_request.base.repo.full_name }}) + if [ $SOURCE_NAME != $REMOTE_NAME ]; then + echo "PR should be created from a branch on the source repo, not from a fork, so the E2E tests can run. If you need access please reach out to the #help-virtuoso channel." + exit 1 + fi + # 1) Check for all incoming changes to files under `recipes` directory - name: Get Changed Files id: getfile