-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Karim Eldegwy
committed
Apr 16, 2024
1 parent
7fa8063
commit 210c1c5
Showing
2 changed files
with
48 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,50 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
name: Check Multi-package | ||
trigger: none | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- karimeldegwy/* | ||
paths: | ||
- 'SPECS/**' | ||
- 'SPECS-EXTENDED/**' | ||
pr: | ||
branches: | ||
include: | ||
- 1.0-dev | ||
- main | ||
- 3.0-dev | ||
- karimeldegwy/** | ||
|
||
permissions: 'write-all' | ||
paths: | ||
include: | ||
- SPECS/** | ||
- SPECS-EXTENDED/** | ||
|
||
variables: | ||
- group: "Agent pools (DEV)" | ||
|
||
resources: | ||
repositories: | ||
- repository: CBL-Mariner-Pipelines | ||
type: git | ||
name: mariner/CBL-Mariner-Pipelines | ||
|
||
jobs: | ||
detect-changes: | ||
runs-on: ubuntu-latest | ||
- job: 'MultiPackageCheck' | ||
pool: | ||
name: "$(DEV_AMD64_Ubuntu_Managed)" | ||
type: linux | ||
isCustom: true | ||
timeoutInMinutes: 15 | ||
displayName: 'Add reviewer if multi-package addition/removal detected' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Ensures history for all branches is available | ||
|
||
- name: Check Multi-package addition/removal | ||
run: | | ||
.github/workflows/check-multi-package-addition-removal.sh | ||
- script: | | ||
echo "Checking for multi-package addition/removal" | ||
result=$(./.github/workflows/check-multi-package-addition-removal.sh) | ||
echo "##vso[task.setvariable variable=MULTI_PACKAGE_ADD_REMOVE_DETECTED;isOutput=true]$result" | ||
displayName: 'Check Multi-package Addition/Removal' | ||
env: | ||
GITHUB_BASE_REF: ${{ github.base_ref }} | ||
GITHUB_WORKSPACE: ${{ github.workspace }} | ||
GITHUB_BASE_REF: $(System.PullRequest.TargetBranch) | ||
GITHUB_WORKSPACE: $(Build.SourcesDirectory) | ||
name: checkMultiPackage | ||
- name: Add Reviewer if Duplicates Found | ||
if: env.MULTI_PACKAGE_ADD_REMOVE_DETECTED == 'true' | ||
run: | | ||
curl \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
https://api.github.com/repos/microsoft/azurelinux/pulls/${{ github.event.pull_request.number }}/requested_reviewers \ | ||
-d '{"team_reviewers": ["cbl-mariner-multi-package-reviewers"]}' | ||
- template: pipelines/multi-package/AddMultiPackTeamAsReviewer.yml@CBL-Mariner-Pipelines | ||
condition: and(succeeded(), eq(dependencies.MultiPackageCheck.outputs['checkMultiPackage.MULTI_PACKAGE_ADD_REMOVE_DETECTED'], 'true')) | ||
parameters: | ||
prID: $(System.PullRequest.PullRequestId) |