Skip to content

chore(Components): page e2e test [YTFRONT-3772] #1746

chore(Components): page e2e test [YTFRONT-3772]

chore(Components): page e2e test [YTFRONT-3772] #1746

name: "[ci]: Commit titles"
on:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: titles
run: |
curl ${{ github.event.pull_request.commits_url }} > commits.txt
cat commits.txt | jq '.[].commit.message' | sed -E 's/\\n.*/"/g' | jq -r > titles.txt
grep -vE '^(build|chore|ci|docs|feat|fix|refactor|revert|test)(\(\S+\))?!?: [a-z]+' titles.txt > bad_titles.txt || true
if [ "$(cat bad_titles.txt | wc -c)" -gt 0 ]; then
echo "Please check your commit titles, they should correspond to https://www.conventionalcommits.org/en/v1.0.0/";
echo -e "\nThe titles below should be fixed:";
cat bad_titles.txt
false
fi
- name: "feat|fix"
run: |
grep -E '^(feat|fix)(\(\S+\))?!?: [a-z]+' titles.txt > feat-fix.txt || (
echo "You have to provide at least one 'feat'|'fix' commit to publish new versions of changed packages.";
echo "If you don't want to release new version then just ignore the check.";
false
)
- name: "issue|ticket"
run: |
grep -P '\[(#\d+)|(YTFRONT-\d+)\]$' feat-fix.txt || (
echo "At least one of your commits should be linked with an issue or a ticket.";
echo "Such commit should contain '[#xxx]' or '[YTFRONT-xxx]' at the end of title".;
echo "If you don't want to link your PR with any issue/ticket then just ignore the check";
cat feat-fix.txt;
false
)