From 372af4b6c961cd047a9de8026b69892ed9584a87 Mon Sep 17 00:00:00 2001 From: mchavez Date: Wed, 10 Jul 2024 12:57:41 -0600 Subject: [PATCH 1/2] Update go version in tests. Fix goreleaser. --- .github/workflows/release.yaml | 8 ++++---- .goreleaser.docker.yaml | 3 ++- .goreleaser.yaml | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 06766d87..0d3e36c0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,9 +25,9 @@ jobs: p12-file-base64: ${{ secrets.APPLE_SIGNING_KEY_P12 }} p12-password: ${{ secrets.APPLE_SIGNING_KEY_P12_PASSWORD }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v6 with: - version: latest + version: "~> v2" args: release --clean env: GITHUB_TOKEN: ${{ secrets.RELENG_GITHUB_TOKEN }} @@ -53,9 +53,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v6 with: - version: latest + version: "~> v2" args: release --clean -f .goreleaser.docker.yaml env: GITHUB_TOKEN: ${{ secrets.RELENG_GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.docker.yaml b/.goreleaser.docker.yaml index 7b5b44c0..f7ac80d1 100644 --- a/.goreleaser.docker.yaml +++ b/.goreleaser.docker.yaml @@ -1,3 +1,4 @@ +version: 2 project_name: baton-snipe-it builds: - binary: baton-snipe-it @@ -51,4 +52,4 @@ checksum: release: disable: true changelog: - skip: true \ No newline at end of file + disable: true \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 96ce9555..9948ac21 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,4 @@ +version: 2 project_name: baton-snipe-it builds: - binary: baton-snipe-it @@ -65,10 +66,10 @@ checksum: - glob: ./dist/*-darwin-amd64.zip - glob: ./dist/*-darwin-arm64.zip brews: - - tap: + - repository: owner: conductorone name: homebrew-baton - folder: Formula + directory: Formula homepage: https://conductorone.com test: | system "#{bin}/baton-snipe-it -v" From 34c8b5c07bc64d98623aa802d36318219a3cb7bf Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Tue, 16 Jul 2024 11:10:00 -0700 Subject: [PATCH 2/2] Fix lint error. --- pkg/snipe-it/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/snipe-it/client.go b/pkg/snipe-it/client.go index 02161f19..de7cfda7 100644 --- a/pkg/snipe-it/client.go +++ b/pkg/snipe-it/client.go @@ -55,7 +55,7 @@ func (c *Client) Validate(ctx context.Context) error { res, err := c.Do(req) if err != nil { baseUrl := strings.TrimSuffix(c.baseUrl, "/") - if res.StatusCode == 404 && strings.HasSuffix(baseUrl, "api/v1") { + if res.StatusCode == http.StatusNotFound && strings.HasSuffix(baseUrl, "api/v1") { c.baseUrl = strings.TrimSuffix(baseUrl, "api/v1") return c.Validate(ctx) }