Skip to content

Commit 922ac8b

Browse files
feat: read github api/graphql url from action context (#532)
* feat: read github api/graphql url from action context * fix tests Co-authored-by: Jeff Ching <chingor@google.com>
1 parent 4482754 commit 922ac8b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ inputs:
7575
github-api-url:
7676
description: 'configure github API URL. Default `https://api.github.com`'
7777
required: false
78-
default: ''
78+
default: ${{ github.api_url }}
7979
github-graphql-url:
8080
description: 'configure github GraphQL URL. Default `https://api.github.com`'
8181
required: false
82-
default: ''
82+
default: ${{ github.graphql_url }}
8383
repo-url:
8484
description: 'configure github repository URL. Default `process.env.GITHUB_REPOSITORY`'
8585
required: false

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function getGitHubInput () {
1818
defaultBranch: core.getInput('default-branch') || undefined,
1919
repoUrl: core.getInput('repo-url') || process.env.GITHUB_REPOSITORY,
2020
apiUrl: core.getInput('github-api-url') || GITHUB_API_URL,
21-
graphqlUrl: core.getInput('github-graphql-url') || GITHUB_GRAPHQL_URL,
21+
graphqlUrl: (core.getInput('github-graphql-url') || '').replace(/\/graphql$/, '') || GITHUB_GRAPHQL_URL,
2222
token: core.getInput('token', { required: true })
2323
}
2424
}

0 commit comments

Comments
 (0)