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

make octokit instance available as octokit on top of github, to make it easier to seamless to copy examples from GitHub api or octokit documentation #508

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iamstarkov
Copy link

@iamstarkov iamstarkov commented Jan 15, 2025

examples on GitHub api documentation use octokit as an octokit instance, so does the octokit documentation itself. its kinda a bummer to always rename when you copy from documentation or from another files.

I understand that octokit was made available over the github keyword, and I dont want to break that, but it won't hurt nobody to expose octokit instance over the octokit keyword as well and it will help people who use documentation a lot

// api docs
await octokit.request('GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls', {
  owner: 'OWNER',
  repo: 'REPO',
  commit_sha: 'COMMIT_SHA',
})

// octokit documentation
octokit.rest.repos.listPullRequestsAssociatedWithCommit({
  owner,
  repo,
  commit_sha,
});

what do you think? if this is something you are up for adding, let me know and I adjust documentation accordingly

…it easier to seamless to copy examples from GitHub api or octokit documentation
@iamstarkov iamstarkov requested a review from a team as a code owner January 15, 2025 18:22
@joshmgross
Copy link
Member

Thanks for the suggestion @iamstarkov - my one concern with this change is that users may assume octokit is Octokit and that could create additional confusion if something does not work as expected.

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 this pull request may close these issues.

2 participants