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

"cancelInvitation" not found #155

Closed
Timmmy-nlb opened this issue Jun 24, 2021 · 5 comments
Closed

"cancelInvitation" not found #155

Timmmy-nlb opened this issue Jun 24, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@Timmmy-nlb
Copy link

Timmmy-nlb commented Jun 24, 2021

Describe the bug
A method, which should be available according to the documentation of octokit, does not exist.
I get error Unhandled error: TypeError: github.orgs.cancelInvitation is not a function.
Other like github.orgs.listPendingInvitations works as expected.

To Reproduce

- name: CancelInvitation
  uses: actions/github-script@v4
  [...]
  script: |
       github.orgs.cancelInvitation({
                org: "organization",
                invitation_id: 00000,
        });

A call from console.log('Test: ', github.orgs); shows that the method is really missing.

Expected behavior
That the method can be used, as the other.

Desktop (please complete the following information):

  • OS: Win10
  • Browser Firefox, Chrome

Additional context
coming from this help ticket octokit/plugin-rest-endpoint-methods.js#403

@Simran-B
Copy link

The endpoint was added upstream via octokit/plugin-rest-endpoint-methods.js#320 in January (v4.6.0) 😞
#133 is also caused by outdated dependencies. However, I tried to bump everything to latest but it's still missing the methods for some reason - am I doing something wrong?

@Simran-B
Copy link

Found the problem: Octokit used to expose REST endpoints directly, like octokit.actions.cancelWorkflowRun. They are now nested under octokit.rest, e.g. octokit.rest.actions.cancelWorkflowRun. My updated github-script action works if I use github.rest.* instead of github.*.

@joshmgross joshmgross added the bug Something isn't working label Jun 28, 2021
@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. Remove the "Stale" label or comment on the issue, or it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 28, 2021
@Timmmy-nlb
Copy link
Author

Is there anything I can do or test so that we can continue this issue?

@joshmgross
Copy link
Member

👋 Hey @Timmmy-nlb,

I've just released https://github.com/actions/github-script/releases/tag/v5.0.0 which includes the latest version of Octokit with this API.

Note you'll need to update your script to use github.rest.orgs.cancelInvitation due to changes in Octokit, see https://github.com/actions/github-script#breaking-changes-in-v5.

Feel free to reopen this issue if you're still seeing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants