diff --git a/.github/workflows/CommitMessage.yml b/.github/workflows/CommitMessage.yml new file mode 100644 index 0000000000..5a397561b3 --- /dev/null +++ b/.github/workflows/CommitMessage.yml @@ -0,0 +1,35 @@ +name: Commit messages check +on: + pull_request: + +jobs: + gitlint: + name: Check commit messages + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install dependencies + run: | + pip install --upgrade gitlint + - name: Lint git commit messages + run: | + gitlint --commits origin/$GITHUB_BASE_REF.. >> cmlint.log 2>&1 + echo 'lint_result<<###LINT_DELIMITER###' >> $GITHUB_ENV + lint_output=$(cat cmlint.log) + echo "${lint_output}" + echo "THIS Just ain't working" >> $GETHUB_ENV + echo "$lint_output" >> $GITHUB_ENV + echo '###LINT_DELIMITER###' >> $GITHUB_ENV + echo "${lint_output}" >> $GITHUB_STEP_SUMMARY + - name: Comment on PR + if: failure() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Commit Comment + message: | + ``` + ${{ env.lint_result }} + ``` \ No newline at end of file