Migrate from @octokit/action to @octokit/core for better maintainability #1146
+5,840
−32,431
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR migrates the GitHub API client from
@octokit/action
to@octokit/core
to improve maintainability and follow official Octokit recommendations. The@octokit/action
package is designed specifically for direct JavaScript usage in GitHub Actions workflows, while@octokit/core
provides a more general and future-proof approach.Changes Made
Dependencies
@octokit/action@^6.0.7
@octokit/core@^7.0.2
and@octokit/plugin-rest-endpoint-methods@^16.0.0
Code Changes
src/install.ts
to use@octokit/core
with explicitGITHUB_TOKEN
authenticationGITHUB_TOKEN
is missingfindLatestVersion()
function to explicitly check for and requireGITHUB_TOKEN
Testing Improvements
GITHUB_TOKEN
scenarioConfiguration Updates
Behavior Changes
Before
After
Backward Compatibility
✅ Fully backward compatible - No breaking changes to the public API. Users will continue to use the action exactly as before, but will now receive clearer error messages when
GITHUB_TOKEN
is missing.Testing
All existing tests pass, plus new test coverage for:
GITHUB_TOKEN
providedGITHUB_TOKEN
is missingBenefits
GITHUB_TOKEN
is missingThe migration ensures that the action continues to work exactly as expected while providing a more robust foundation for future development.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.