diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d540252..bd7b9c1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -8,6 +8,10 @@ name: Lint # yamllint disable-line rule:truthy on: [pull_request, push] +concurrency: + group: ci-${{ github.ref }}-1 + cancel-in-progress: true + jobs: lint: runs-on: ubuntu-latest @@ -17,11 +21,16 @@ jobs: - name: Install OS packages # yamllint disable-line rule:line-length run: sudo apt-get install -y python3-dev python3-pip shellcheck reuse + # gitlint is available on Debian but Ubuntu has an older version. - name: Install pip packages run: pip3 install salt-lint gitlint - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: actions/setup-python@v3 - uses: pre-commit/action@v3.0.0 + # TODO: lint range of commits, not only the latest pushed - name: Gitlint - run: pwd; gitlint --debug + # yamllint disable-line rule:line-length + run: gitlint --debug --commits "${{ github.event.before }}..${{ github.sha }}"