Skip to content

Commit c0144e6

Browse files
arunanshubabhisek
andauthored
feat: update go version to latest (#589)
* feat: update go version to latest * update workflow * use bookworm * revert fixture * fix dockerfile run * use more modern debian image --------- Co-authored-by: Abhisek Datta <abhisek.datta@gmail.com>
1 parent d3c87b6 commit c0144e6

10 files changed

Lines changed: 107 additions & 116 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
- name: Set up Go
2222
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
2323
with:
24-
go-version: 1.24.3
25-
check-latest: true
24+
go-version-file: go.mod
2625

2726
- name: Build and Test
2827
run: |
@@ -52,7 +51,7 @@ jobs:
5251
- name: Set up Go
5352
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
5453
with:
55-
go-version: 1.24.3
54+
go-version-file: go.mod
5655
check-latest: true
5756

5857
- name: Build vet
@@ -81,31 +80,30 @@ jobs:
8180
runs-on: ubuntu-latest
8281
timeout-minutes: 15
8382
steps:
84-
- name: Checkout Source
85-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
86-
87-
- name: Setup QEMU
88-
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
89-
90-
- name: Setup Docker Buildx
91-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
92-
93-
- name: Build Multi-Platform Container Image (verification only)
94-
run: |
95-
docker buildx build --platform linux/amd64,linux/arm64 \
96-
-t build-container-test:latest .
97-
98-
- name: Build and Load Native Platform Image for Testing
99-
run: |
100-
docker buildx build --platform linux/amd64 --load \
101-
-t build-container-test:latest .
102-
103-
- name: Test Container Image
104-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
105-
run: |
106-
docker run --rm \
107-
-e VET_API_KEY=${{ secrets.SAFEDEP_CLOUD_API_KEY }} \
108-
-e VET_CONTROL_TOWER_TENANT_ID=${{ secrets.SAFEDEP_CLOUD_TENANT_DOMAIN }} \
109-
build-container-test:latest \
110-
auth verify
83+
- name: Checkout Source
84+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
11185

86+
- name: Setup QEMU
87+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
88+
89+
- name: Setup Docker Buildx
90+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
91+
92+
- name: Build Multi-Platform Container Image (verification only)
93+
run: |
94+
docker buildx build --platform linux/amd64,linux/arm64 \
95+
-t build-container-test:latest .
96+
97+
- name: Build and Load Native Platform Image for Testing
98+
run: |
99+
docker buildx build --platform linux/amd64 --load \
100+
-t build-container-test:latest .
101+
102+
- name: Test Container Image
103+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
104+
run: |
105+
docker run --rm \
106+
-e VET_API_KEY=${{ secrets.SAFEDEP_CLOUD_API_KEY }} \
107+
-e VET_CONTROL_TOWER_TENANT_ID=${{ secrets.SAFEDEP_CLOUD_TENANT_DOMAIN }} \
108+
build-container-test:latest \
109+
auth verify

.github/workflows/codeql.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
19+
branches: ["main"]
2020

2121
permissions:
2222
contents: read
@@ -35,34 +35,34 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
language: [ 'go' ]
38+
language: ["go"]
3939

4040
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
41+
- name: Checkout repository
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
4343

44-
- name: Set up Go
45-
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
46-
with:
47-
go-version: 1.24.3
48-
check-latest: true
44+
- name: Set up Go
45+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
46+
with:
47+
go-version-file: go.mod
48+
check-latest: true
4949

50-
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2
52-
with:
53-
languages: ${{ matrix.language }}
54-
# If you wish to specify custom queries, you can do so here or in a config file.
55-
# By default, queries listed here will override any specified in a config file.
56-
# Prefix the list here with "+" to use these queries and those in the config file.
50+
- name: Initialize CodeQL
51+
uses: github/codeql-action/init@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2
52+
with:
53+
languages: ${{ matrix.language }}
54+
# If you wish to specify custom queries, you can do so here or in a config file.
55+
# By default, queries listed here will override any specified in a config file.
56+
# Prefix the list here with "+" to use these queries and those in the config file.
5757

58-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
59-
# queries: security-extended,security-and-quality
58+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
59+
# queries: security-extended,security-and-quality
6060

61-
- run: |
62-
go mod tidy
63-
go build
61+
- run: |
62+
go mod tidy
63+
go build
6464
65-
- name: Perform CodeQL Analysis
66-
uses: github/codeql-action/analyze@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2
67-
with:
68-
category: "/language:${{matrix.language}}"
65+
- name: Perform CodeQL Analysis
66+
uses: github/codeql-action/analyze@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2
67+
with:
68+
category: "/language:${{matrix.language}}"

.github/workflows/container.yml

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,45 +27,43 @@ jobs:
2727
id-token: write
2828

2929
steps:
30-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
31-
with:
32-
submodules: true
33-
fetch-depth: 0
30+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
31+
with:
32+
submodules: true
33+
fetch-depth: 0
3434

35-
- name: Registry Login
36-
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7
37-
with:
38-
registry: ${{ env.REGISTRY }}
39-
username: ${{ github.actor }}
40-
password: ${{ secrets.GITHUB_TOKEN }}
35+
- name: Registry Login
36+
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7
37+
with:
38+
registry: ${{ env.REGISTRY }}
39+
username: ${{ github.actor }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
4141

42-
- name: Setup QEMU
43-
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7
42+
- name: Setup QEMU
43+
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7
4444

45-
- name: Setup Docker Buildx
46-
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55
45+
- name: Setup Docker Buildx
46+
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55
4747

48-
- name: Build and Push Container Image
49-
run: |
50-
# Get the tag if this was a tag push event
51-
if [[ "${{ github.ref_type }}" == "tag" ]]; then
52-
TAG=${{ github.ref_name }}
53-
# Validate tag format (must be vX.Y.Z)
54-
if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
55-
# Build and push with both version tag and latest
48+
- name: Build and Push Container Image
49+
run: |
50+
# Get the tag if this was a tag push event
51+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
52+
TAG=${{ github.ref_name }}
53+
# Validate tag format (must be vX.Y.Z)
54+
if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
55+
# Build and push with both version tag and latest
56+
docker buildx build --push --platform linux/amd64,linux/arm64 \
57+
-t $REGISTRY/$IMAGE_NAME:$TAG \
58+
-t $REGISTRY/$IMAGE_NAME:latest \
59+
.
60+
else
61+
echo "Invalid tag format. Must be in format vX.Y.Z (e.g. v1.2.3)"
62+
exit 1
63+
fi
64+
else
65+
# For non-tag pushes, just use latest tag
5666
docker buildx build --push --platform linux/amd64,linux/arm64 \
57-
-t $REGISTRY/$IMAGE_NAME:$TAG \
5867
-t $REGISTRY/$IMAGE_NAME:latest \
5968
.
60-
else
61-
echo "Invalid tag format. Must be in format vX.Y.Z (e.g. v1.2.3)"
62-
exit 1
6369
fi
64-
else
65-
# For non-tag pushes, just use latest tag
66-
docker buildx build --push --platform linux/amd64,linux/arm64 \
67-
-t $REGISTRY/$IMAGE_NAME:latest \
68-
.
69-
fi
70-
71-

.github/workflows/dependency-review.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Source repository: https://github.com/actions/dependency-review-action
66
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
7-
name: 'Dependency Review'
7+
name: "Dependency Review"
88
on: [pull_request]
99

1010
permissions:
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 15
1717
steps:
18-
- name: 'Checkout Repository'
18+
- name: "Checkout Repository"
1919
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
20-
- name: 'Dependency Review'
20+
- name: "Dependency Review"
2121
uses: actions/dependency-review-action@cc4f6536e38d1126c5e3b0683d469a14f23bfea4 # v3

.github/workflows/golangci-lint.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@ on:
66
permissions:
77
contents: read
88
pull-requests: read
9+
910
jobs:
1011
golangci:
1112
name: lint
1213
runs-on: ubuntu-latest
1314
timeout-minutes: 30
1415
steps:
15-
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
16+
- uses: actions/checkout@v5
17+
18+
- uses: actions/setup-go@v6
1619
with:
17-
go-version: 1.24.3
18-
cache: false
19-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
20+
go-version-file: go.mod
21+
2022
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
23+
uses: golangci/golangci-lint-action@v8
2224
with:
2325
version: latest
2426
args: --issues-exit-code=1 --timeout=10m
2527
only-new-issues: true
26-
skip-pkg-cache: true
27-
skip-build-cache: true
28-

.github/workflows/goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Go
3737
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
3838
with:
39-
go-version: 1.24.3
39+
go-version-file: go.mod
4040
check-latest: true
4141
- name: ghcr-login
4242
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ on:
1010
# To guarantee Maintained check is occasionally updated. See
1111
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
1212
schedule:
13-
- cron: '35 22 * * 0'
13+
- cron: "35 22 * * 0"
1414
push:
15-
branches: [ "main" ]
15+
branches: ["main"]
1616

1717
# Declare default permissions as read only.
1818
permissions: read-all

Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM golang:1.24.3-bullseye@sha256:abe2e2bb9bc0342dd1ba2f719af5c6b3859ca9ad93a7d9bcdd21310bda0327e1 AS build
2-
# Original: golang:1.24.3-bullseye
1+
FROM --platform=$BUILDPLATFORM golang:1.25-bookworm AS build
32

43
WORKDIR /build
54

@@ -21,18 +20,17 @@ ENV CGO_ENABLED=1
2120
# Set up cross-compilation environment based on target platform
2221
RUN case "${TARGETPLATFORM}" in \
2322
"linux/amd64") \
24-
CC=gcc CXX=g++ GOOS=linux GOARCH=amd64 make quick-vet ;; \
23+
CC=gcc CXX=g++ GOOS=linux GOARCH=amd64 make quick-vet ;; \
2524
"linux/arm64") \
26-
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ GOOS=linux GOARCH=arm64 make quick-vet ;; \
25+
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ GOOS=linux GOARCH=arm64 make quick-vet ;; \
2726
*) echo "Unsupported platform: ${TARGETPLATFORM}" && exit 1 ;; \
2827
esac
2928

30-
FROM debian:11-slim@sha256:e4b93db6aad977a95aa103917f3de8a2b16ead91cf255c3ccdb300c5d20f3015
31-
# Original: debian:11-slim
29+
FROM debian:12-slim@sha256:b1a741487078b369e78119849663d7f1a5341ef2768798f7b7406c4240f86aef
3230

3331
RUN apt-get update && apt-get install -y --no-install-recommends \
34-
ca-certificates \
35-
&& rm -rf /var/lib/apt/lists/*
32+
ca-certificates \
33+
&& rm -rf /var/lib/apt/lists/*
3634

3735
ARG TARGETPLATFORM
3836

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/safedep/vet
22

3-
go 1.24.3
3+
go 1.25.1
44

55
require (
66
buf.build/gen/go/safedep/api/grpc/go v1.5.1-20250819072717-b69aa2c62a0d.2

pkg/parser/fixtures/gha/.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Set up Go
3232
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
3333
with:
34-
go-version: 1.22
34+
go-version-file: go.mod
3535
check-latest: true
3636

3737

@@ -47,5 +47,3 @@ jobs:
4747

4848
- name: Setup Docker Buildx
4949
uses: docker/setup-buildx-action@v2
50-
51-

0 commit comments

Comments
 (0)