Skip to content

"cancelInvitation" not found #155

Description

@Timmmy-nlb

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

Activity

  1. Simran-B commented on Jun 25, 2021

    @Simran-B

    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?

  2. Simran-B commented on Jun 25, 2021

    @Simran-B

    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.*.

  3. github-actions commented on Aug 28, 2021

    @github-actions

    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.

  4. Timmmy-nlb commented on Aug 30, 2021

    @Timmmy-nlb
    Author

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

  5. joshmgross commented on Sep 24, 2021

    @joshmgross
    Contributor

    👋 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions