Skip to content

Commit

Permalink
actions: use go-version-file: .go-version (#1841)
Browse files Browse the repository at this point in the history
see actions/setup-go#295

(cherry picked from commit 3d8e3c7)
  • Loading branch information
v1v authored and mergify[bot] committed Nov 30, 2022
1 parent 8fb2a0e commit 6c26ccd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6c26ccd

Please sign in to comment.