feature: Added CI to verify proper formatting of PR titles. #7
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: Verify PR Title | |
on: | |
pull_request: | |
types: [opened, edited, reopened] | |
jobs: | |
verify-title: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v2 | |
- name: Verify PR Title | |
id: verify | |
run: | | |
PREFIXES="query:|.*:" | |
if [[ ! "${{ github.event.pull_request.title }}" =~ ^(${PREFIXES}) ]]; then | |
echo "PR title does not follow the required format: 'prefix: description'" | |
echo "::error::PR title must start with one of the following prefixes: query:, .*:" | |
exit 1 | |
else | |
echo "PR title is valid." | |
fi |