diff --git a/action.yml b/action.yml index 2536c19..701fc8e 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/index.js b/index.js index bc50326..0ca70ef 100644 --- a/index.js +++ b/index.js @@ -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 }) } }