Skip to content

Commit

Permalink
Remove third party GH action (hashicorp#213)
Browse files Browse the repository at this point in the history
* Remove third party GH action

Simplifies reading the file by just using a `cat` and the built-in functions for `::set-output`: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#using-workflow-commands-to-access-toolkit-functions

* remove third party GH action from ci workflow too

Co-authored-by: Radek Simko <radek.simko@gmail.com>
  • Loading branch information
paultyng and radeksimko authored Jul 8, 2020
1 parent 36adf18 commit e8411e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
-
name: Read go version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v1
Expand Down Expand Up @@ -54,18 +54,26 @@ jobs:
name: Unshallow
run: git fetch --prune --unshallow
-
name: Read go version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
name: Read go version (Unix)
if: ${{ runner.os != 'Windows' }}
id: go-version-unix
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Read go version (Windows)
if: ${{ runner.os == 'Windows' }}
id: go-version-win
run: |
$content = Get-Content .\.go-version -Raw
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v1
with:
# TODO: Replace with go-version-from-file when it is supported
# https://github.com/actions/setup-go/pull/62
go-version: ${{ steps.go-version.outputs.content }}
go-version: ${{ steps.go-version-unix.outputs.content || steps.go-version-win.outputs.content }}
-
name: Go mod verify
run: go mod verify
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
-
name: Read go version
id: go-version
uses: juliangruber/read-file-action@v1
with:
path: ./.go-version
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v1
Expand Down

0 comments on commit e8411e8

Please sign in to comment.