Skip to content

ci: Create web-kit-pull-request.yml #132

ci: Create web-kit-pull-request.yml

ci: Create web-kit-pull-request.yml #132

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