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 seamlessly copy examples from GitHub rest api or octokit documentations #508

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

iamstarkov
Copy link
Contributor

@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

@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.

@iamstarkov
Copy link
Contributor Author

iamstarkov commented Jan 19, 2025

my two cents would be that I used github-scripts heavily in the last few years and I'd not make that mistake, and also I think javascript developers are grown to know the difference Class and an instance.
That is to say, your concerns are not without merit, but I dont think we should underestimate developers. If we want, we have an option to remedy this potential issue by explicitly passing Octokit class explicitly

And my last argument will be that consistency with documentation will lead to net-smaller confusion after all. What do you think?

@joshmgross
Copy link
Member

@iamstarkov I'm fine with this change - could we update the documentation as well to make it clear that this is an option?

@iamstarkov
Copy link
Contributor Author

@joshmgross absolutely

iamstarkov and others added 2 commits January 31, 2025 11:20
…it easier to seamless to copy examples from GitHub api or octokit documentation
@iamstarkov
Copy link
Contributor Author

@joshmgross updated documentation as we agreed, feel free to take a look

@iamstarkov
Copy link
Contributor Author

checked out project locally, adjusted types and committed updated dist folder accordingly

@iamstarkov iamstarkov changed the title 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 make octokit instance available as octokit on top of github, to make it easier to seamlessly copy examples from GitHub rest api or octokit documentations Jan 31, 2025
@iamstarkov
Copy link
Contributor Author

iamstarkov commented Jan 31, 2025

I have off topic to PR question, which i'm curious about

GitHub assigned this PR to a team without assigning anyone.

Screenshot 2025-01-31 at 12 00 05

is CODEOWNERS correct and @actions/actions-launch exists, but its not public?

@joshmgross
Copy link
Member

@iamstarkov yes that is a team, that's not my area of GitHub but my understanding is that organization teams are never public and can only be internal to all organization members or hidden.

@iamstarkov iamstarkov temporarily deployed to debug-integration-test February 4, 2025 15:45 — with GitHub Actions Inactive
@joshmgross joshmgross merged commit 378a50f into actions:main Feb 4, 2025
14 checks passed
@iamstarkov iamstarkov deleted the patch-2 branch February 4, 2025 21:05
@iamstarkov
Copy link
Contributor Author

how does the release process look like for this action? I noticed 41 unreleased commits since last release

joshmgross added a commit to joshmgross/actions-testing that referenced this pull request Feb 26, 2025
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