Skip to content

Commit

Permalink
Use Go version in go.mod (#1010)
Browse files Browse the repository at this point in the history
* Use Go version in go.mod

* Fix typo
  • Loading branch information
int128 authored Dec 10, 2023
1 parent 7672853 commit b5dceb3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,21 @@ on:
- '!**/*.md'

jobs:
go-version:
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
go-version: ${{ steps.go-version.outputs.go-version }}
steps:
- uses: actions/checkout@v4
- id: go-version
run: echo "go-version=$(sed -ne '/^go /s/^go //p' go.mod)" >> "$GITHUB_OUTPUT"

build:
needs: go-version
uses: int128/docker-build-workflow/.github/workflows/build.yaml@v1
with:
build-args: go_version=${{ needs.go-version.outputs.go-version }}

e2e-test:
runs-on: ubuntu-latest
Expand All @@ -37,7 +50,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.5
go-version-file: go.mod

# set up the test environment
- uses: actions/create-github-app-token@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
go:
uses: int128/kubebuilder-workflows/.github/workflows/go.yaml@v1
with:
go-version: 1.21.5
go-version-file: go.mod
golangci-lint-version: v1.55.2
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build the manager binary
FROM golang:1.21 as builder
ARG go_version
FROM golang:${go_version} as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/int128/argocd-commenter

go 1.21
go 1.21.5

require (
github.com/argoproj/argo-cd/v2 v2.9.3
Expand Down

0 comments on commit b5dceb3

Please sign in to comment.