diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5140f7e..71610a4 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -7,15 +7,18 @@ workflow_dispatch: jobs: - warning: + check: if: github.event.pull_request.head.repo.fork == true runs-on: ubuntu-latest steps: - - name: Warning - Cannot run from fork - shell: bash + - name: Checking for Fork + shell: pwsh run: | - echo "WARNING: This workflow cannot be run from a Fork. Please follow the release branch process if you need to run end to end tests." - + $isFork = $${{ github.event.pull_request.head.repo.fork }} + if($isFork) { + echo "### WARNING: This workflow is disabled for forked repositories. Please follow the release branch process if end to end tests are required." >> $GITHUB_STEP_SUMMARY + } + run-e2e-tests: if: github.event.repository.name != 'terraform-azurerm-avm-template' && github.event.pull_request.head.repo.fork == false uses: Azure/terraform-azurerm-avm-template/.github/workflows/test-examples-template.yml@main diff --git a/.github/workflows/test-examples-template.yml b/.github/workflows/test-examples-template.yml index 4bbe3d4..26cf28c 100644 --- a/.github/workflows/test-examples-template.yml +++ b/.github/workflows/test-examples-template.yml @@ -5,15 +5,6 @@ on: workflow_call: jobs: - warning: - if: github.event.pull_request.head.repo.fork == true - runs-on: ubuntu-latest - steps: - - name: Warning - Cannot run from fork - shell: bash - run: | - echo "WARNING: This workflow cannot be run from a Fork. Please follow the release branch process if you need to run end to end tests." - getexamples: if: github.event.repository.name != 'terraform-azurerm-avm-template' && github.event.pull_request.head.repo.fork == false runs-on: ubuntu-latest