migrate to new release branch based workflow

This commit is contained in:
hezijie 2024-09-14 09:18:50 +08:00
parent ca492527f3
commit b482962a1b

View File

@ -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: |