Skip to content

Commit

Permalink
Merge pull request #9080 from Azure/ignore-dependabot-pr-from-azure-p…
Browse files Browse the repository at this point in the history
…ipeline

Ignore dependabot pr from azure pipeline
  • Loading branch information
v-amolpatil authored Sep 25, 2023
2 parents fb3e009 + e6c376e commit d8d82e4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .azure-pipelines/callGithubWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ jobs:
$branchName = "$(System.PullRequest.SourceBranch)"
$targetBranch = "$(System.PullRequest.TargetBranch)"
$pullRequestNumber = "$(System.PullRequest.PullRequestNumber)"
$isAutoGeneratedPR = [bool]($branchName -match "-automated-pr")
Write-Host "BranchName is $branchName, pullRequestNumber $pullRequestNumber, isAutoGeneratedPR $isAutoGeneratedPR"
$isAutoGeneratedOrDependabotPR = [bool]($branchName -match "dependabot/|-automated-pr")
Write-Host "BranchName is $branchName, pullRequestNumber $pullRequestNumber, isAutoGeneratedOrDependabotPR $isAutoGeneratedOrDependabotPR"
# NOT MAIN/MASTER OR AUTOMATED BRANCH
if ($branchName -ne 'master' -and $isAutoGeneratedPR -eq $false -and $targetBranch -eq 'master')
if ($branchName -ne 'master' -and $isAutoGeneratedOrDependabotPR -eq $false -and $targetBranch -eq 'master')
{
# INVOKE GITHUB WORKFLOW
$header = @{
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
}
else
{
Write-Host "Skipping Github Workflow from execution as current branch is a Master branch or is a automated PR or target branch is not master."
Write-Host "Skipping Github Workflow from execution as current branch is a Master branch/Automated PR/Dependabot or target branch is not master."
}
}
catch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checkAutomatedPR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
pull-requests: read

env:
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref && github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}
BODY: ${{ github.event.issue.body }}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checkPRContentChange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- "Solutions/**"

env:
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref && github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}

jobs:
solutionNameDetails:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checkSkipPackagingInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
value: ${{ jobs.checkPackagingInfoStatus.outputs.isPackagingRequired }}

env:
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref && github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}

jobs:
checkPackagingInfoStatus:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/getSolutionName.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
value: ${{ jobs.currentPRSolutionName.outputs.sName }}

env:
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref && github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}

jobs:
currentPRSolutionName:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/neworexistingsolution.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
value: ${{ jobs.masterDetails.outputs.solutionPublisherId }}

env:
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref && github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}

jobs:
masterDetails:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/package-command.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:
DEFAULTPACKAGEVERSION: "${{ vars.DEFAULTPACKAGEVERSION }}"
BLOB_CONN_STRING: "${{ secrets.BLOB_CONN_STRING }}"
BASE_FOLDER_PATH: "${{ vars.BASEFOLDERPATH }}"
BRANCH_NAME: "${{ github.event.client_payload.pull_request.head.ref && github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}"
BRANCH_NAME: "${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}"
ADO_TOKEN: "${{ secrets.ADO_TOKEN }}"
ADO_BASE_URL: "${{ vars.ADO_BASE_URL }}"
ADO_AREAPATH: "${{ vars.ADO_AREAPATH }}"
Expand All @@ -18,13 +18,13 @@ on:
types: [package-command, Package-command, PACKAGE-command]
jobs:
solutionNameDetails:
if: ${{ github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork }}
if: ${{ !github.event.pull_request.head.repo.fork && !contains(github.event.client_payload.pull_request.head.ref , 'dependabot/') && !contains(github.event.client_payload.pullRequestBranchName , 'dependabot/') }}
uses: ./.github/workflows/getSolutionName.yaml
secrets: inherit

# BELOW JOB WILL CHECK IF WE NEED TO SKIP PACKAGE CREATION OR NOT
checkSkipPackagingDetails:
if: ${{ github.actor != 'dependabot[bot]' && needs.solutionNameDetails.outputs.solutionName != '' && !github.event.pull_request.head.repo.fork }}
if: ${{ needs.solutionNameDetails.outputs.solutionName != '' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/workflows/checkSkipPackagingInfo.yaml
secrets: inherit
needs: solutionNameDetails
Expand All @@ -34,7 +34,7 @@ jobs:
neworexistingsolution:
needs: [solutionNameDetails, checkSkipPackagingDetails]
uses: ./.github/workflows/neworexistingsolution.yaml
if: ${{ github.actor != 'dependabot[bot]' && needs.solutionNameDetails.outputs.solutionName != '' && needs.checkSkipPackagingDetails.outputs.isPackagingRequired == 'True' }}
if: ${{ needs.solutionNameDetails.outputs.solutionName != '' && needs.checkSkipPackagingDetails.outputs.isPackagingRequired == 'True' }}
with:
solutionName: "${{ needs.solutionNameDetails.outputs.solutionName }}"
secrets: inherit
Expand Down

0 comments on commit d8d82e4

Please sign in to comment.