diff --git a/.azure-pipelines/callGithubWorkflow.yaml b/.azure-pipelines/callGithubWorkflow.yaml index 75f957cb716..4187a447070 100644 --- a/.azure-pipelines/callGithubWorkflow.yaml +++ b/.azure-pipelines/callGithubWorkflow.yaml @@ -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 = @{ @@ -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 diff --git a/.github/workflows/checkAutomatedPR.yaml b/.github/workflows/checkAutomatedPR.yaml index 985be930309..c55d2d20f31 100644 --- a/.github/workflows/checkAutomatedPR.yaml +++ b/.github/workflows/checkAutomatedPR.yaml @@ -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: diff --git a/.github/workflows/checkPRContentChange.yaml b/.github/workflows/checkPRContentChange.yaml index f7f0bd77de6..bd531286ee2 100644 --- a/.github/workflows/checkPRContentChange.yaml +++ b/.github/workflows/checkPRContentChange.yaml @@ -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: diff --git a/.github/workflows/checkSkipPackagingInfo.yaml b/.github/workflows/checkSkipPackagingInfo.yaml index 04c52087acc..5e759884a1a 100644 --- a/.github/workflows/checkSkipPackagingInfo.yaml +++ b/.github/workflows/checkSkipPackagingInfo.yaml @@ -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: diff --git a/.github/workflows/getSolutionName.yaml b/.github/workflows/getSolutionName.yaml index d032f45fe72..0f1843d436e 100644 --- a/.github/workflows/getSolutionName.yaml +++ b/.github/workflows/getSolutionName.yaml @@ -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: diff --git a/.github/workflows/neworexistingsolution.yaml b/.github/workflows/neworexistingsolution.yaml index 0417824ef0a..75992944384 100644 --- a/.github/workflows/neworexistingsolution.yaml +++ b/.github/workflows/neworexistingsolution.yaml @@ -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: diff --git a/.github/workflows/package-command.yaml b/.github/workflows/package-command.yaml index a965591febc..0cd58b45b60 100644 --- a/.github/workflows/package-command.yaml +++ b/.github/workflows/package-command.yaml @@ -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 }}" @@ -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 @@ -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