Skip to content

Instantly share code, notes, and snippets.

@luandevpro
Created August 16, 2020 05:24
Show Gist options
  • Save luandevpro/5f1d964a3b51c822e881336e1083d7ac to your computer and use it in GitHub Desktop.
Save luandevpro/5f1d964a3b51c822e881336e1083d7ac to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
)
func main() {
// Access Inputs as environment vars
firstGreeting := os.Getenv("INPUT_FIRSTGREETING")
secondGreeting := os.Getenv("INPUT_SECONDGREETING")
thirdGreeting := os.Getenv("INPUT_THIRDGREETING")
// Use those inputs in the actions logic
fmt.Println("Hello " + firstGreeting)
fmt.Println("Hello " + secondGreeting)
// Someimes inputs are not "required" and we can build around that
if thirdGreeting != "" {
fmt.Println("Hello " + thirdGreeting)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment