octokit / octokit.js

The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
MIT License
6.86k stars 1k forks source link

[FEAT]: Support overriding github api url in create-github-app-token github action #2569

Closed harshtrivedi134 closed 8 months ago

harshtrivedi134 commented 8 months ago

Describe the need

Reference from discussion I was creating an access token for a github app installed in a different organization and repository. I learned about https://github.com/actions/create-github-app-token#create-a-token-for-all-repositories-in-another-owners-installation.

Similar to the baseUrl option in Octokit constructor, it would be great if we could specify the github API url as an input to this action

      - uses: actions/create-github-app-token@v1
        id: get-access-token
        with:
          app-id: APP_ID
          private-key: PRIVATE_KEY
          base-url: https://slack-github.com/api/

I tried creating an access token for my github app installed in a different organization by specifying the owner and repository using the following:

      - uses: actions/create-github-app-token@v1
        id: get-access-token
        with:
          app-id: APP_ID
          private-key: PRIVATE_KEY
          owner: "owner"
          repositories: |
            owner/repo_name

However, the default github API hostname/url is set to api.github.com and we cannot change it to a custom hosted github installation.

Code of Conduct

github-actions[bot] commented 8 months ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

gr2m commented 8 months ago

closing in favor of https://github.com/actions/create-github-app-token/issues/77. The issue is not related to octokit, let's discuss over at the repository of the GitHub Action itself