feat: add prettifier #998
This file contains 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: 'Branch Name PR Check' | |
on: | |
workflow_call: | |
pull_request: | |
types: [opened, reopened, synchronize, edited] | |
jobs: | |
pr-branch-name-check: | |
name: 'Check PR for semantic branch name' | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Set PR branch validity' | |
id: is-semantic | |
if: > | |
startsWith(github.event.pull_request.head.ref, 'feat/') || | |
startsWith(github.event.pull_request.head.ref, 'ci/') || | |
startsWith(github.event.pull_request.head.ref, 'fix/') || | |
startsWith(github.event.pull_request.head.ref, 'docs/') || | |
startsWith(github.event.pull_request.head.ref, 'test/') || | |
startsWith(github.event.pull_request.head.ref, 'refactor/') || | |
startsWith(github.event.pull_request.head.ref, 'style/') || | |
startsWith(github.event.pull_request.head.ref, 'build/') || | |
startsWith(github.event.pull_request.head.ref, 'chore/') || | |
startsWith(github.event.pull_request.head.ref, 'revert/') || | |
startsWith(github.event.pull_request.head.ref, 'dependabot/') || | |
startsWith(github.event.pull_request.head.ref, 'dev') | |
run: | | |
OUTPUT=true | |
echo "isSemantic=$OUTPUT" >> $GITHUB_OUTPUT | |
- name: 'echo isSemantic' | |
run: | | |
echo ${{ steps.is-semantic.outputs.isSemantic }} | |
- name: 'Branch name is valid' | |
if: ${{steps.is-semantic.outputs.isSemantic == 'true'}} | |
run: | | |
echo 'Pull request branch name is valid.' | |
echo ${{ steps.is-semantic.outputs.isSemantic }} | |
- name: 'Branch name is invalid' | |
if: ${{ steps.is-semantic.outputs.isSemantic != 'true'}} | |
run: | | |
echo ${{ steps.is-semantic.outputs.isSemantic }} | |
echo 'Pull request branch name is not valid.' | |
echo 'branch name must start with one of:' | |
echo ' feat/,' | |
echo ' ci/,' | |
echo ' fix/,' | |
echo ' docs/,' | |
echo ' test/,' | |
echo ' refactor/,' | |
echo ' style/,' | |
echo ' build/,' | |
echo ' chore/,' | |
echo ' revert/,' | |
echo ' dependabot/,' | |
echo ' dev' | |
exit 1 |