build(deps): bump peter-evans/create-or-update-comment from 2 to 5 #186
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: "Target Branch PR Check" | |
| on: | |
| workflow_call: | |
| pull_request: | |
| types: [opened, reopened, synchronize, edited] | |
| jobs: | |
| pr-branch-confirmation: | |
| name: "Confirm that target branch for PR is main or master" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "echo PR target branch" | |
| run: | | |
| echo ${{ github.event.pull_request.base.ref }} | |
| - name: "Set PR target branch validity" | |
| id: is-valid | |
| if: > | |
| startsWith(github.event.pull_request.base.ref, 'master')|| | |
| startsWith(github.event.pull_request.base.ref, 'main') || | |
| startsWith(github.event.pull_request.base.ref, 'chore/dependabot') || | |
| startsWith(github.event.pull_request.base.ref, 'build/') | |
| run: | | |
| OUTPUT=true | |
| echo "isValid=$OUTPUT" >> $GITHUB_OUTPUT | |
| - name: "echo isValid" | |
| run: | | |
| echo ${{ steps.is-valid.outputs.isValid }} | |
| - name: "PR target branch is valid" | |
| if: ${{steps.is-valid.outputs.isValid == 'true'}} | |
| run: | | |
| echo 'Pull request target branch is valid.' | |
| echo ${{ steps.is-valid.outputs.isValid }} | |
| - name: "PR target branch is invalid" | |
| if: ${{ steps.is-valid.outputs.isValid != 'true'}} | |
| run: | | |
| echo ${{ steps.is-valid.outputs.isValid }} | |
| echo 'Pull request target branch is not valid.' | |
| exit 1 |