Skip to content

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

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

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

Workflow file for this run

name: "Semantic PR Check"
on:
workflow_call:
pull_request:
types: [opened, reopened, synchronize, edited]
jobs:
pr-title-check:
name: "Check PR for semantic title"
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: "Set PR title validity"
id: is-semantic
if: >
startsWith(github.event.pull_request.title, 'feat:')||
startsWith(github.event.pull_request.title, 'fix:') ||
startsWith(github.event.pull_request.title, 'perf:') ||
startsWith(github.event.pull_request.title, 'docs:') ||
startsWith(github.event.pull_request.title, 'test:') ||
startsWith(github.event.pull_request.title, 'refactor:') ||
startsWith(github.event.pull_request.title, 'style:') ||
startsWith(github.event.pull_request.title, 'build:') ||
startsWith(github.event.pull_request.title, 'ci:') ||
startsWith(github.event.pull_request.title, 'chore:') ||
startsWith(github.event.pull_request.title, 'revert:')
run: |
OUTPUT=true
echo "isSemantic=$OUTPUT" >> $GITHUB_OUTPUT
- name: "echo isSemantic"
run: |
echo ${{ steps.is-semantic.outputs.isSemantic }}
- name: "PR title is valid"
if: ${{steps.is-semantic.outputs.isSemantic == 'true'}}
run: |
echo 'Pull request title is valid.'
echo ${{ steps.is-semantic.outputs.isSemantic }}
- name: "PR title is invalid"
if: ${{ steps.is-semantic.outputs.isSemantic != 'true'}}
run: |
echo ${{ steps.is-semantic.outputs.isSemantic }}
echo 'Pull request title, ${{github.event.pull_request.title}} is not valid.'
echo 'title must start with one of:'
echo ' build:,'
echo ' chore:,'
echo ' ci:,'
echo ' docs:,'
echo ' feat:,'
echo ' fix:,'
echo ' perf:,'
echo ' refactor:,'
echo ' revert:,'
echo ' style:,'
echo ' test:'
exit 1