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

Dependencies: Public docs no longer match some API methods #1715

Open
robburger opened this issue Apr 11, 2024 · 1 comment
Open

Dependencies: Public docs no longer match some API methods #1715

robburger opened this issue Apr 11, 2024 · 1 comment

Comments

@robburger
Copy link

Relates to the @actions/github package.

Problem

With the recent changes introduced in octokit/plugin-rest-endpoint-methods.js#721 (v12.0.0), the public octokit/rest.js documentation here no longer matches the method signatures for the following:

  • (delete|get|list)EnvironmentSecret(s)
  • (create|delete|get|list|update)EnvironmentVariable(s)
  • getEnvironmentPublicKey

Previously, a repository_id parameter was required, now it can be called with owner and repo params.

Note: the old endpoints still work, so nothing is broken, but it's confusing referencing the public docs and having an IDE complaining that incorrect params are being passed in. (Also affects calls to the above methods in GHA workflows using https://github.com/actions/github-script)

Example

Public Docs:

octokit.rest.actions.getEnvironmentVariable({
  owner,
  repo,
  environment_name,
  name,
});

VSCode:

octokit.rest.actions.getEnvironmentVariable({
  repository_id,
  environment_name,
  name,
});
image

Fix

Bumping the @octokit/plugin-rest-endpoint-methods dependency here should resolve this, but will be a breaking change.

@wolfy1339
Copy link

Hi 👋 , @octokit maintainer here,

You will have to also bump @octokit/core to v6 and @octokit/plugin-paginate-rest to v11 due to the switch to ESM in these versions

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

No branches or pull requests

2 participants