Skip to content

Replace @action/github dependency with latest Octokit #614

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joshmgross
Copy link
Contributor

@joshmgross joshmgross commented Jun 3, 2025

This replaces the dependency of @actions/github with a more direct dependency on Octokit via @octokit/action - https://github.com/octokit/action.js.

@actions/github is on a very old version of Octokit and is preventing users of this action from using the latest GitHub APIs in their scripts:

Using Octokit in a more direct manner will allow this action to keep up date with dependencies in a more timely manner going forward.

This will likely break some user scripts, both from "expected" breaking changes from a multi-version bump of Octokit and unexpected breakages from new or different behavior in @octokit/action or this action that we're not correctly replicating from @actions/github. My hope is that integration tests will catch the more significant scenarios, but we should expect some bugs with the v8 version of this action once it's released - #556.

Comment on lines +4 to +5
"module": "Node16",
"moduleResolution": "node16",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"author": "GitHub",
"license": "MIT",
"main": "dist/index.js",
"type": "module",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly certain this was required when updating Octokit, I don't think it should impact much since this action isn't consumed as a library.

My one concern is that it somehow impacts the custom require functionality this action implements, but integration tests should catch that.

dist/index.js Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure why the dist is so bloated now

id: my-script
with:
result-encoding: string
retries: 3
script: |
github.rest.issues.get({
octokit.rest.issues.get({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting the README changes from #557 - with #508 we should steer users towards using octokit as that will be more documentation and AI friendly 😄

@joshmgross joshmgross marked this pull request as ready for review June 3, 2025 02:02
@joshmgross joshmgross requested a review from a team as a code owner June 3, 2025 02:02
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.

1 participant