Allow to add token from within the action.yml file.
This commit is contained in:
parent
9bd9f4bfb8
commit
c555e77ad0
|
@ -4,6 +4,9 @@ runs:
|
|||
using: 'go'
|
||||
main: 'main.go'
|
||||
inputs:
|
||||
token:
|
||||
description: 'Access token which allow to create pull requests'
|
||||
default: ${{ github.token }}
|
||||
title:
|
||||
required: false
|
||||
description: The title of the pull request
|
||||
|
@ -23,6 +26,7 @@ inputs:
|
|||
head:
|
||||
description: >
|
||||
The pull request head branch (the one within the new code is developed).
|
||||
|
||||
outputs:
|
||||
pull-request-number:
|
||||
description: 'The pull request number'
|
||||
|
|
4
main.go
4
main.go
|
@ -69,9 +69,9 @@ func main() {
|
|||
githubactions.Fatalf("could not get context: %v", err.Error())
|
||||
}
|
||||
|
||||
token := os.Getenv("GITHUB_TOKEN")
|
||||
token := githubactions.GetInput("token")
|
||||
fmt.Printf("Api url is %v\n", ctx.ServerURL)
|
||||
fmt.Printf("Debug: GITHUB_TOKEN begins with %v (4 first characters) and length is %d\n", token[0:4], len(token))
|
||||
fmt.Printf("Debug: token begins with %v (4 first characters) and length is %d\n", token[0:4], len(token))
|
||||
|
||||
config, err := ParseActionConfig(*ctx)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue