Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
feat: read github api/graphql url from action context (#532)
Browse files Browse the repository at this point in the history
* feat: read github api/graphql url from action context

* fix tests

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
goatwu1993 and chingor13 authored Aug 10, 2022
1 parent 4482754 commit 922ac8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ inputs:
github-api-url:
description: 'configure github API URL. Default `https://api.github.com`'
required: false
default: ''
default: ${{ github.api_url }}
github-graphql-url:
description: 'configure github GraphQL URL. Default `https://api.github.com`'
required: false
default: ''
default: ${{ github.graphql_url }}
repo-url:
description: 'configure github repository URL. Default `process.env.GITHUB_REPOSITORY`'
required: false
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function getGitHubInput () {
defaultBranch: core.getInput('default-branch') || undefined,
repoUrl: core.getInput('repo-url') || process.env.GITHUB_REPOSITORY,
apiUrl: core.getInput('github-api-url') || GITHUB_API_URL,
graphqlUrl: core.getInput('github-graphql-url') || GITHUB_GRAPHQL_URL,
graphqlUrl: (core.getInput('github-graphql-url') || '').replace(/\/graphql$/, '') || GITHUB_GRAPHQL_URL,
token: core.getInput('token', { required: true })
}
}
Expand Down

0 comments on commit 922ac8b

Please sign in to comment.