Skip to content
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

[BUG]: when setting baseUrl as part of parameters, the baseUrl is not passed through to getInstallationAuthentication #640

Closed
1 task done
gr2m opened this issue Sep 3, 2024 · 2 comments · Fixed by #641
Labels
released Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented, or is being fixed

Comments

@gr2m
Copy link
Contributor

gr2m commented Sep 3, 2024

What happened?

Minimal reproducible test case

const { App, Octokit } = require("octokit");

run();

async function run() {
  const app = new App({
    appId: process.env.APP_ID,
    privateKey: process.env.PRIVATE_KEY,
    Octokit: Octokit.plugin((octokit) => {
      octokit.hook.before("request", async (options) => {
        options.baseUrl = "https://example.com";
      });
    }),
  });

  // we only have one installation, it's a private app
  const octokit = await app.getInstallationOctokit(1);

  const { data: repository } = await octokit.request(
    "GET /repositories/:repository_id",
    {
      repository_id: 102985470,
    }
  );
}

This results in a POST https://api.github.com/app/installations/1/access_tokens, but it should have been POST https://example.com/app/installations/1/access_tokens

Versions

6.1.1, but I assume this bug has been around for a while

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@gr2m gr2m added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented, or is being fixed labels Sep 3, 2024
Copy link
Contributor

github-actions bot commented Sep 3, 2024

👋 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 labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

Copy link
Contributor

github-actions bot commented Sep 3, 2024

🎉 This issue has been resolved in version 7.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented, or is being fixed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant