From 6c26ccdc63f76e2ba4feb05c863f752ec8ecaa1b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 30 Nov 2022 14:32:07 +0000 Subject: [PATCH] actions: use go-version-file: .go-version (#1841) see https://github.com/actions/setup-go/pull/295 (cherry picked from commit 3d8e3c73667c33a10ab82361ead19500d4f6a5bf) --- .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 d0f29a0fd25..c118bae8821 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 62d4006737c..73116460c67 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 bf3e5eed775..23a7c6a4da8 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