Skip to content

Make an API call to a self-hosted/enterprise instance #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
UbiquitousBear opened this issue Jun 9, 2021 · 3 comments
Closed

Make an API call to a self-hosted/enterprise instance #150

UbiquitousBear opened this issue Jun 9, 2021 · 3 comments

Comments

@UbiquitousBear
Copy link

Is your feature request related to a problem? Please describe.
It looks like there's no way to configure the API host: https://github.com/actions/github-script/blob/main/action.yml

Describe the solution you'd like
Ability to configure the API host to make it compatible with GitHub Enterprise Server.

@joshmgross
Copy link
Member

👋 Hey @UbiquitousBear, you should be able to be able to set the API URL using the GITHUB_API_URL environment variable -

https://github.com/actions/toolkit/blob/11601c0d2dbb2d2cf287c77d03cc3e53866a4f56/packages/github/src/internal/utils.ts#L23-L25

Example:

      - uses: actions/github-script@v4
        env:
          GITHUB_API_URL: 'https://example.com'
        with:
          script: |
            github.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: '👋 Thanks for reporting!'
            })

@UbiquitousBear
Copy link
Author

@joshmgross looks great - thanks!

@rajbos
Copy link

rajbos commented Jul 28, 2023

Retriggering this as this setup does not work, I think this is caused by the changes that environment variables cannot start with the GITHUB prefix anymore, at least since the introduction of Configuration Variables.

Can a different variable be introduced for this to over write the behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants