chore: fix sonar issues #100
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 Checker | |
on: | |
pull_request_target: | |
branches: [ v2.x.x, v3.x.x ] | |
types: [opened, reopened, edited] | |
jobs: | |
PRInstructions: | |
name: PR Instructions | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.user.login != 'zowe-robot' | |
steps: | |
- name: Check PR title | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TITLE: ${{ github.event.pull_request.title }} | |
PR: ${{ github.event.pull_request.html_url }} | |
run: | | |
for prefix in 'fix:' 'feat:' 'docs:' 'refactor:' 'chore:'; do | |
case $TITLE in | |
"$prefix"*) | |
echo "PR title starts with '$prefix'" | |
exit 0 | |
esac | |
done | |
echo "PR title doesn't start with any of allowed prefixes" | |
gh pr edit $PR --add-label 'invalid' | |
gh pr comment $PR --body 'It looks like PR title does not contain one of the required prefixes: `fix:`, `feat:`, `docs:`, `refactor:`, `chore:`. Please add one of the prefixes based on the type of your changes by following our [contributing guidelines](https://github.com/zowe/api-layer/blob/v3.x.x/CONTRIBUTING.md#type)' |