Closed codebydant closed 1 year ago
I think I have found a way to implement this check without action.
- name: Checkout current repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Check Duplicated Commit Subject
if: ${{ success() || failure() }}
run: |
max_commit=$(git log origin/${{ github.event.pull_request.base.ref }}.. --oneline | cut -c 9- | sort | uniq -c | sort -n | tail -1 | grep -qE '^\s*[1-1]+'; echo $?)
if [ $max_commit == 0 ]
then
echo Hey All commit looks good.
exit 0
else
echo Hey you have duplicated commit messages
git log origin/${{ github.event.pull_request.base.ref }}.. --oneline | cut -c 9- | sort | uniq -c | sort -n
exit 1
fi
shell: bash
Code of Conduct
Is there an existing issue for this?
Are you willing to sponsor your idea?
Is your feature request related to a problem? Please describe
Hi folks,
Thanks for this life-saving tool.
I was thinking that could be really cool to provide some checks for duplicity in the commit messages. This is because sometimes new contributor does not take care of the commit messages when developing and uses the same message for all commits.
Describe the solution you'd like
It would be wonderful to have some input parameters to check duplicity such as:
This will take an input commit list and check duplicity.
Describe alternatives you've considered
Maybe using a regex pattern, but I don't know how to apply this
Additional context
No response