Versasec CMS Initial Solution Version #13054
This file contains hidden or 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
| name: Check For PR Content And Add Label | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - "Solutions/**" | |
| env: | |
| BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }} | |
| jobs: | |
| solutionNameDetails: | |
| if: ${{ github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && !contains(github.event.pull_request.labels.*.name, 'Content-Package') }} | |
| uses: ./.github/workflows/getSolutionName.yaml | |
| secrets: inherit | |
| checkPRContent: | |
| if: ${{ github.actor != 'dependabot[bot]' && needs.solutionNameDetails.outputs.solutionName != '' && !github.event.pull_request.head.repo.fork }} | |
| name: Check PR Content And Add Label | |
| runs-on: ubuntu-latest | |
| needs: solutionNameDetails | |
| env: | |
| SOLUTION_NAME: "${{ needs.solutionNameDetails.outputs.solutionName }}" | |
| outputs: | |
| hasContentPackageChange: ${{ steps.changesInPR.outputs.hasContentPackageChange }} | |
| steps: | |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
| with: | |
| fetch-depth: 2 | |
| ref: "${{ env.BRANCH_NAME }}" | |
| - name: Identify Changes in PR | |
| shell: pwsh | |
| id: changesInPR | |
| run: | | |
| $instrumentationKey = "${{ vars.APPINSIGHTS }}" | |
| $runId = "${{ github.run_id }}" | |
| $solutionName = "${{ needs.solutionNameDetails.outputs.solutionName }}" | |
| $pullRequestNumber = "${{ github.event.pull_request.number && github.event.pull_request.number || github.event.client_payload.pullRequestNumber }}" | |
| Write-Host "PR Number $pullRequestNumber , solutionName $solutionName" | |
| ./.script/package-automation/checkPRContentChange.ps1 $solutionName $pullRequestNumber $runId $instrumentationKey | |
| addLabelWhenContentPackage: | |
| name: Add Label of Content Package | |
| needs: checkPRContent | |
| if: ${{ needs.checkPRContent.outputs.hasContentPackageChange == 'True' && !github.event.pull_request.head.repo.fork }} | |
| uses: ./.github/workflows/addLabelOnPr.yaml | |
| with: | |
| labelName: "Content-Package" | |
| secrets: inherit |