Created
May 31, 2022 07:18
-
-
Save matthiasbeyer/0cea6298547f4f629f9cb624c639e6eb to your computer and use it in GitHub Desktop.
Revisions
-
matthiasbeyer created this gist
May 31, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ name: lint commit messages on: pull_request: jobs: commit-lint: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v3 with: ref: ${{ github.even.pull_request.head.sha }} # Checkout pull request HEAD commit instead of merge commit fetch-depth: 0 # fetch complete history - uses: actions/setup-python@v3 with: python-version: '3.10' - name: Install gitlint run: pip install gitlint - name: Run gitlint run: | if [[ -z "${GITHUB_BASE_REF}" ]]; then BASE=origin/master else BASE="${GITHUB_BASE_REF}" fi echo "Linting: ${BASE}..HEAD" gitlint --commits ${BASE}..HEAD