From 0a954c6922515842c29db8eafe5a0f453efcfd48 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 11 Apr 2025 09:48:15 +0200 Subject: [PATCH 1/6] gha: update codeql actions to v3 Signed-off-by: Sebastiaan van Stijn --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 318d617..3b642d8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,12 +44,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 From f34892d5082c0226f7ad9decdf596018cbb601e0 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 11 Apr 2025 09:49:17 +0200 Subject: [PATCH 2/6] gha: update fossa-contrib/fossa-action@v3 Signed-off-by: Sebastiaan van Stijn --- .github/workflows/fossa.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From f4a09992bff3c6c81ee1cdb532118cb8991fa7d1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 11 Apr 2025 09:58:10 +0200 Subject: [PATCH 3/6] gha: golangci/golangci-lint-action@v7, golangci-lint v2.0.x Signed-off-by: Sebastiaan van Stijn --- .github/workflows/test.yml | 4 ++-- .golangci.yml | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d345e9..ec853cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,9 +34,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 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 From fa05a2bd787c69c6ccbc6da1234a139d377854fd Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 11 Apr 2025 09:58:44 +0200 Subject: [PATCH 4/6] gha: update codecov/codecov-action@v5 Signed-off-by: Sebastiaan van Stijn --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec853cc..0aa53bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,6 @@ jobs: make coverage - name: Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: directory: ./ From 8650ce9f9ff6d7e93065aadb0e1d04ee2cf93537 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 11 Apr 2025 10:07:37 +0200 Subject: [PATCH 5/6] gha: test against Go "oldest", stable and oldstable, drop 1.20 Signed-off-by: Sebastiaan van Stijn --- .github/workflows/test.yml | 5 ++++- go.mod | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0aa53bc..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 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 From f0f7bf2412385ad369300a82cdae57aeba3a7108 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 11 Apr 2025 12:38:33 +0200 Subject: [PATCH 6/6] gha: run codeQL on PRs, and add comment for cron Signed-off-by: Sebastiaan van Stijn --- .github/workflows/codeql-analysis.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3b642d8..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)