Skip to content

Commit

Permalink
add GITHUB prefix to env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
hxrxchang committed Nov 26, 2023
1 parent f3f8590 commit acc7a88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .envrc.test
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export ACCESS_TOKEN=""
export REPOSITORY=""
export GITHUB_TOKEN=""
export GITHUB_REPOSITORY=""
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "gtd-manager"
description: "Extract and register only the incomplete tasks from yesterday's issue into a new issue"
inputs:
ACCESS_TOKEN: # id of input
GITHUB_TOKEN: # id of input
description: "Access token which has read and write access to issues"
required: true
default: ""
REPOSITORY:
GITHUB_REPOSITORY:
description: "Repository name"
required: true
default: ""
Expand All @@ -29,4 +29,4 @@ runs:
shell: bash
env:
TZ: ${{ inputs.TIME_ZONE }}
run: ACCESS_TOKEN=${{ inputs.ACCESS_TOKEN}} REPOSITORY=${{ inputs.REPOSITORY }} gtd
run: GITHUB_TOKEN=${{ inputs.GITHUB_TOKEN}} GITHUB_REPOSITORY=${{ inputs.GITHUB_REPOSITORY }} gtd
8 changes: 4 additions & 4 deletions pkg/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
)

func GetGitHubInfo() (string, string, string, error) {
token := os.Getenv("ACCESS_TOKEN")
ghrepo := os.Getenv("REPOSITORY")
token := os.Getenv("GITHUB_TOKEN")
ghrepo := os.Getenv("GITHUB_REPOSITORY")

if token == "" {
return "", "", "", fmt.Errorf("ACCESS_TOKEN is required")
return "", "", "", fmt.Errorf("GITHUB_TOKEN is required")
}

if ghrepo == "" {
return "", "", "", fmt.Errorf("REPOSITORY is required")
return "", "", "", fmt.Errorf("GITHUB_REPOSITORY is required")
}

username := strings.Split(ghrepo, "/")[0]
Expand Down

0 comments on commit acc7a88

Please sign in to comment.