diff --git a/action.yml b/action.yml index 0892ae88..c434cee0 100644 --- a/action.yml +++ b/action.yml @@ -4,12 +4,18 @@ description: 'Find LaunchDarkly Flags in your Pull Request' runs: using: 'docker' image: 'Dockerfile' + env: + LD_PROJ_KEY: ${{ inputs.projKey }} + LD_ACCESS_TOKEN: ${{ inputs.accessToken }} + LD_BASE_URI: ${{ inputs.baseUri }} + LD_ENV_KEY: ${{ inputs.envKey }} + GITHUB_TOKEN: ${{ inputs.githubToken }} inputs: - project: + projKey: description: 'LaunchDarkly Project' required: true default: 'default' - environment: + envKey: description: 'LaunchDarkly Environment for Project' required: true default: 'prod' @@ -17,3 +23,6 @@ inputs: description: 'LaunchDarkly Instance' required: no default: 'https://app.launchdarkly.com' + githubToken: + description: 'Token to access your GitHub repository.' + required: true diff --git a/main.go b/main.go index bb1403f6..a9e58fc9 100644 --- a/main.go +++ b/main.go @@ -26,15 +26,15 @@ import ( ) func main() { - ldProject := os.Getenv("INPUT_PROJECT") + ldProject := os.Getenv("LD_PROJ_KEY") if ldProject == "" { fmt.Println("`project` is required.") } - ldEnvironment := os.Getenv("INPUT_ENVIRONMENT") + ldEnvironment := os.Getenv("LD_ENV_KEY") if ldEnvironment == "" { fmt.Println("`environment` is required.") } - ldInstance := os.Getenv("INPUT_INSTANCE") + ldInstance := os.Getenv("LD_BASE_URI") if ldEnvironment == "" { fmt.Println("`baseUri` is required.") } @@ -45,9 +45,9 @@ func main() { if err != nil { fmt.Printf("error parsing GitHub event payload at %q: %v", os.Getenv("GITHUB_EVENT_PATH"), err) } - apiToken := os.Getenv("LAUNCHDARKLY_ACCESS_TOKEN") + apiToken := os.Getenv("LD_ACCESS_TOKEN") if apiToken == "" { - fmt.Println("LAUNCHDARKLY_ACCESS_TOKEN is not set.") + fmt.Println("LD_ACCESS_TOKEN is not set.") os.Exit(1) }