feat: making pr comment a common action #107
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: PR Name Check | |
on: | |
pull_request: | |
branches: | |
- 'dev' | |
types: [opened, edited, synchronize] | |
jobs: | |
check-pr-name: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v2 | |
- name: Check PR title | |
run: | | |
if ! echo "${{ github.event.pull_request.title }}" | grep -Eq "^(feat|fix|BREAKING CHANGE)(\([^)]+\))?: "; then | |
echo 'FAIL_OUTPUT=Invalid PR title. It must start with feat: or fix: or BREAKING CHANGE: or feat(<DESCRIPTOR>): or fix(<DESCRIPTOR>): or BREAKING CHANGE(<DESCRIPTOR>):' >> $GITHUB_ENV | |
exit 1 | |
fi | |
- name: Comment on PR | |
if: failure() | |
uses: ./.github/actions/pr-comment | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
pr_comment: ${{ env.FAIL_OUTPUT }} |