actions / toolkit

The GitHub ToolKit for developing GitHub Actions.
https://github.com/features/actions
MIT License
4.93k stars 1.42k forks source link

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

Open robburger opened 5 months ago

robburger commented 5 months ago

Relates to the @actions/github package.

Problem

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

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 commented 5 months ago

Hi :wave: , @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