diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 318d617..b91cd57 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -6,6 +6,15 @@ concurrency: on: schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12) + # │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday) + # │ │ │ │ │ + # │ │ │ │ │ + # │ │ │ │ │ + # * * * * * - cron: '0 12 * * 6' push: branches: @@ -14,6 +23,10 @@ on: tags: - 'v*' pull_request: + # The branches below must be a subset of the branches above + branches: + - 'main' + - 'release/*' permissions: contents: read # to fetch code (actions/checkout) @@ -44,12 +57,12 @@ jobs: git checkout HEAD^2 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index 919944b..a71bd20 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -20,6 +20,6 @@ jobs: uses: actions/checkout@v4 - name: Run FOSSA scan and upload build data - uses: fossa-contrib/fossa-action@v2 + uses: fossa-contrib/fossa-action@v3 with: fossa-api-key: cac3dc8d4f2ba86142f6c0f2199a160f diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d345e9..6029f0a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,10 @@ jobs: build: strategy: matrix: - go-version: [1.21.x, 1.22.x] + go-version: + - 1.21.x # oldest supported (see go.mod) + - oldstable + - stable os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} timeout-minutes: 10 @@ -34,9 +37,9 @@ jobs: make build - name: lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v7 with: - version: v1.59 + version: v2.0 args: --print-resources-usage --timeout=10m --verbose - name: Test @@ -44,6 +47,6 @@ jobs: make coverage - name: Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: directory: ./ diff --git a/.golangci.yml b/.golangci.yml index 793f0bb..70834e0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,18 +1,21 @@ +version: "2" linters: enable: - bodyclose - - dupword # Checks for duplicate words in the source code - - gofmt - - goimports - - ineffassign + - dupword - misspell - revive - - staticcheck - unconvert - - unused - - vet disable: - errcheck - -run: - deadline: 2m + exclusions: + generated: disable + presets: + - comments + - std-error-handling +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: disable diff --git a/go.mod b/go.mod index 25cf64a..e82b093 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/distribution/reference -go 1.20 +go 1.21 require github.com/opencontainers/go-digest v1.0.0