CommitMessageCheck #11
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: Commit Message Check | |
run-name: CommitMessageCheck | |
on: | |
pull_request: | |
types: [opened, edited, reopened, synchronize] | |
branches: main | |
concurrency: | |
group: 'check_commit' | |
cancel-in-progress: true | |
jobs: | |
check-commit-message: | |
name: Check commit messages | |
environment: github-pages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Get PR Commits | |
id: 'get-pr-commits' | |
uses: tim-actions/get-pr-commits@master | |
with: | |
token: ${{ secrets.CHECK_COMMIT_GITHUB_TOKEN }} | |
- name: Setup variables | |
run: | | |
documentationUrl=$(cat ./public/CNAME) | |
echo "DOCUMENTATION_URL=${documentationUrl}" >> $GITHUB_ENV | |
# - name: Check PR commits | |
# run: | | |
# echo ${{ steps.get-pr-commits.outputs.commits }} > ./commits.json | |
# cat ./commits.json | |
# commits = ${{ steps.get-pr-commits.outputs.commits }} | |
# for value in "${commits[@]}" | |
# do | |
# echo "Value for item array is: $value" | |
# done | |
- name: Post PR Comment | |
if: failure() | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message: Please check the commit messages in this PR! It seems that you have not used emojis, this is a requirement for this project as per our documentation ${{ env.DOCUMENTATION_URL }} | |
refresh-message-position: true | |
allow-repeats: true |