From 5cb76a39a07373243d09801776fecab32fc9ef5e Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 30 Nov 2022 10:55:13 +0000 Subject: [PATCH] actions: use go-version-file: .go-version see https://github.com/actions/setup-go/pull/295 --- .github/workflows/changelog.yml | 4 +--- .github/workflows/golangci-lint.yml | 7 +------ .github/workflows/macos.yml | 4 +--- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index d0f29a0fd2..c118bae882 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -6,11 +6,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Fetch Go version from .go-version - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - uses: actions/setup-go@v3 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: .go-version - name: check pr-has-fragment run: | GOBIN=$PWD/bin go install github.com/elastic/elastic-agent-changelog-tool@latest diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 62d4006737..73116460c6 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -20,14 +20,9 @@ jobs: steps: - uses: actions/checkout@v3 - # Uses Go version from the repository. - - name: Read .go-version file - id: goversion - run: echo "::set-output name=version::$(cat .go-version)" - - uses: actions/setup-go@v3 with: - go-version: "${{ steps.goversion.outputs.version }}" + go-version-file: .go-version - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index bf3e5eed77..23a7c6a4da 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,11 +12,9 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - name: Fetch Go version from .go-version - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - uses: actions/setup-go@v3 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: .go-version - name: Install dependencies run: go install github.com/magefile/mage - name: Run build