From 707b75a587d53444f400a3064709d34ec2497b7b Mon Sep 17 00:00:00 2001 From: joe miller Date: Sun, 26 Nov 2023 17:43:05 +0000 Subject: [PATCH 1/4] gha: use go version from go.mod --- .github/workflows/ci.yaml | 15 +++++---------- go.mod | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 91e850a..2f07f23 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,11 +23,9 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version-file: go.mod - uses: golangci/golangci-lint-action@v3 - with: - version: v1.52.2 # installed here to run lint on the .goreleaser.yml file: - name: Install GoReleaser @@ -39,21 +37,18 @@ jobs: - run: make test release-test: - runs-on: ubuntu-latest # only run goreleaser snapshot on non-main branch if: github.ref != 'refs/heads/main' + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version-file: go.mod - uses: golangci/golangci-lint-action@v3 - with: - version: v1.52.2 - # installed here to run lint on the .goreleaser.yml file: - name: Install GoReleaser uses: goreleaser/goreleaser-action@v4 with: @@ -62,10 +57,10 @@ jobs: - run: make snapshot release: + if: github.ref == 'refs/heads/main' needs: [test] runs-on: ubuntu-latest # only create a release on main builds: - if: github.ref == 'refs/heads/main' steps: - name: checkout code with full history (unshallow) uses: actions/checkout@v3 @@ -77,7 +72,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version-file: go.mod - name: install autotag binary run: | diff --git a/go.mod b/go.mod index 87fd4b3..e17eff0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/planetscale/ghcommit -go 1.20 +go 1.21.4 require ( github.com/jessevdk/go-flags v1.5.0 From 81c61f65f1724a431cb1e342b32f837a666c4f19 Mon Sep 17 00:00:00 2001 From: joe miller Date: Sun, 26 Nov 2023 17:46:08 +0000 Subject: [PATCH 2/4] gha: bump setup to v4 --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2f07f23..7282a01 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: @@ -41,7 +41,7 @@ jobs: if: github.ref != 'refs/heads/main' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: @@ -63,7 +63,7 @@ jobs: # only create a release on main builds: steps: - name: checkout code with full history (unshallow) - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 From e06f0dbd3f20dbca110d398eef62c3f223f09556 Mon Sep 17 00:00:00 2001 From: joe miller Date: Sun, 26 Nov 2023 17:47:40 +0000 Subject: [PATCH 3/4] gha/licensing: ensure correct go version is installed --- .github/workflows/licensing.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/licensing.yaml b/.github/workflows/licensing.yaml index e530f8a..39ed6b8 100644 --- a/.github/workflows/licensing.yaml +++ b/.github/workflows/licensing.yaml @@ -14,8 +14,13 @@ jobs: licensing: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 + + - uses: actions/setup-go@v4 + with: + go-version-file: go.mod + - run: sudo gem install license_finder - run: license_finder From 26cec4f774c524a1bb8ea389b2003581e91e4ecd Mon Sep 17 00:00:00 2001 From: joe miller Date: Sun, 26 Nov 2023 17:52:49 +0000 Subject: [PATCH 4/4] gha: remove redundant tag fetch step --- .github/workflows/ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7282a01..e6b8990 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,9 +66,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: fetch tags - run: git fetch --force --tags + fetch-tags: true - uses: actions/setup-go@v4 with: