Skip to content

Commit

Permalink
{CI} Add branch detection to reject PR whose target branch is main (A…
Browse files Browse the repository at this point in the history
…zure#27046)

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Empty
  • Loading branch information
wangzelin007 authored Aug 1, 2023
1 parent 9efaca2 commit 5286284
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parameters:
jobs:
- job: CheckPullRequest
displayName: "Check the Format of Pull Request Title and Content"
condition: and(succeeded(), in(variables['System.PullRequest.TargetBranch'], 'dev', 'release'))
condition: and(succeeded(), in(variables['System.PullRequest.TargetBranch'], 'dev', 'release', 'main'))

pool:
name: ${{ variables.ubuntu_pool }}
Expand All @@ -44,6 +44,10 @@ jobs:
echo "Hotfix PR should target release branch."
exit 1
fi
if [ "$(System.PullRequest.TargetBranch)" == "main" ]; then
echo "Feature PR should target dev branch."
exit 1
fi
python scripts/ci/check_pull_request.py "$title" "$body"
- job: RejectPullRequestToMasterBranch
Expand Down

0 comments on commit 5286284

Please sign in to comment.