Merge pull request #16 from syscode-labs/release-please--branches--main #171
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 characters
| name: Lint | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| lint: | |
| name: Run on Ubuntu | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone the code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Commit message convention check | |
| if: ${{ !(startsWith(github.head_ref, 'dependabot/') || startsWith(github.ref_name, 'dependabot/')) }} | |
| run: | | |
| python -m pip install --upgrade pip commitizen | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| RANGE="${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" | |
| else | |
| BEFORE="${{ github.event.before }}" | |
| AFTER="${{ github.sha }}" | |
| if [ -n "${BEFORE}" ] && [ "${BEFORE}" != "0000000000000000000000000000000000000000" ] && git cat-file -e "${BEFORE}^{commit}" 2>/dev/null; then | |
| RANGE="${BEFORE}..${AFTER}" | |
| elif git rev-parse --verify "${AFTER}^" >/dev/null 2>&1; then | |
| RANGE="${AFTER}^..${AFTER}" | |
| else | |
| RANGE="${AFTER}..${AFTER}" | |
| fi | |
| fi | |
| echo "Checking commit messages in range: ${RANGE}" | |
| cz check --rev-range "${RANGE}" | |
| - name: Check linter configuration | |
| run: make lint-config | |
| - name: Run linter | |
| run: make lint |