From b482962a1b341d782b538060766fca61870f68b8 Mon Sep 17 00:00:00 2001 From: hezijie Date: Sat, 14 Sep 2024 09:18:50 +0800 Subject: [PATCH] migrate to new release branch based workflow --- .github/workflows/e2e.yaml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index a2aca3b5..b03847e8 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -1,11 +1,11 @@ name: E2E Test Check on: - workflow_dispatch: - inputs: - pr_number: - description: '(Required) pull request number to test against' - type: string - required: true + pull_request: + types: ['opened', 'synchronize'] + paths: + - '.github/**' + - '.github/workflows/**' + - 'quickstart/**' permissions: actions: write contents: read @@ -17,14 +17,24 @@ jobs: environment: name: acctests steps: + - name: Checking for Fork + shell: pwsh + run: | + $isFork = "${{ github.event.pull_request.head.repo.fork }}" + if($isFork -eq "true") { + echo "### WARNING: This workflow is disabled for forked repositories. Please follow the [release branch process](https://azure.github.io/Azure-Verified-Modules/contributing/terraform/terraform-contribution-flow/#5-create-a-pull-request-to-the-upstream-repository) if end to end tests are required." >> $env:GITHUB_STEP_SUMMARY + } - name: checkout + if: github.event.pull_request.head.repo.fork == false uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0 - name: checkout pr + if: github.event.pull_request.head.repo.fork == false env: GH_TOKEN: ${{ github.token }} run: gh pr checkout ${{ inputs.pr_number }} - name: Get changed files + if: github.event.pull_request.head.repo.fork == false id: changed-files uses: tj-actions/changed-files@v34 with: @@ -34,6 +44,7 @@ jobs: files_ignore: "**/TestRecord.md" dir_names_max_depth: 2 - name: test pr + if: github.event.pull_request.head.repo.fork == false env: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: |