flamingo.me/flamingo-commerce/v3@v3.11.0/.github/workflows/golangci-lint.yml (about)

     1  name: golangci-lint
     2  on:
     3    push:
     4      tags:
     5        - v*
     6      branches:
     7        - master
     8    pull_request:
     9  permissions:
    10    contents: read
    11    pull-requests: read
    12  jobs:
    13    golangci:
    14      name: lint
    15      runs-on: ubuntu-latest
    16      env:
    17  #      finds your first commit ahead from master then finds revision before your first commit to be used as starting point for linter
    18        REV: $(FIRST_COMMIT=$(git rev-list --topo-order origin/master..HEAD | tail -1); if [[ $FIRST_COMMIT == '' ]]; then echo $(git rev-parse origin/master^1); else echo $(git rev-parse $FIRST_COMMIT^1); fi)
    19      steps:
    20        - uses: actions/checkout@v4
    21          with:
    22            fetch-depth: '0'
    23        - uses: actions/setup-go@v5
    24          with:
    25            go-version: '1.x'
    26            check-latest: true
    27        - name: Echo start commit
    28          run: |
    29            rev=${{ env.REV }}
    30            if [[ $rev == '' ]]; then echo 'revision not found'; else echo used revision number: $rev; fi
    31        - name: golangci-lint
    32          uses: golangci/golangci-lint-action@v6
    33          with:
    34            version: 'v1.55'
    35            args: $(rev=${{ env.REV }}; if [[ $rev != '' ]]; then echo --new-from-rev=$rev; fi)
    36