feat: 1.0.0 #127
Workflow file for this run
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: "Semantic PR Check" | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- edited | |
- synchronize | |
jobs: | |
main: | |
name: Validate PR title | |
runs-on: ubuntu-latest | |
steps: | |
- uses: amannn/action-semantic-pull-request@v5.5.3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
restrict-merge: | |
name: Restrict PR to main to dev and hotfix/* | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check source branch | |
if: github.event.pull_request.base.ref == 'main' | |
run: | | |
if [[ "${{ github.event.pull_request.head.ref }}" =~ ^(dev|hotfix/.*|release/.*)$ ]]; then | |
echo "Branch name is valid." | |
else | |
echo "Invalid branch name. Only 'dev' or 'hotfix/*' branches can be merged into 'main'." | |
exit 1 | |
fi |