Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use go-version #10

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This action sets up a go environment for use in actions by:

- optionally downloading and caching a version of go by version and adding to PATH
- optionally downloading and caching a version of Go by version and adding to PATH
- registering problem matchers for error output

# Usage
Expand All @@ -19,7 +19,7 @@ steps:
- uses: actions/checkout@master
- uses: actions/setup-go@v1
with:
version: '1.9.3' // The Go version to download (if necessary) and use.
go-version: '1.9.3' // The Go version to download (if necessary) and use.
- run: go run hello.go
```

Expand All @@ -37,7 +37,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v1
with:
version: ${{ matrix.go }}
go-version: ${{ matrix.go }}
- run: go run hello.go
```

Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ name: 'Setup Go environment'
description: 'Setup a Go environment and add it to the PATH, additionally providing proxy support'
author: 'GitHub'
inputs:
version:
go-version:
description: 'The Go version to download (if necessary) and use. Example: 1.9.3'
default: '1.10'
# Deprecated option, do not use. Will not be supported after October 1, 2019
version:
description: 'Deprecated. Use go-version instead. Will not be supported after October 1, 2019'
runs:
using: 'node12'
main: 'lib/setup-go.js'
5 changes: 4 additions & 1 deletion lib/setup-go.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ function run() {
// Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc...
//
const version = core.getInput('version');
let version = core.getInput('version');
if (!version) {
version = core.getInput('go-version');
}
if (version) {
yield installer.getGo(version);
}
Expand Down
5 changes: 4 additions & 1 deletion src/setup-go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ async function run() {
// Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc...
//
const version = core.getInput('version');
let version = core.getInput('version');
if (!version) {
version = core.getInput('go-version');
}
if (version) {
await installer.getGo(version);
}
Expand Down