Skip to content

Update octokit dependency to match online documentation #470

Description

@Battleman

EDIT: the following is still correct, but due to using an outdated version of octokit. After digging some more, it was deprecated 7 months ago:

It would be solved by updating the octokit dependency to at least 10.1.0.

Previous issue:

Describe the bug
The properties defined in octokit.rest.copilot are not consistent with the documentation. It seems the function getCopilotSeatDetailsForUser has been renamed to getCopilotSeatAssignmentDetailsForUser.
According to the octokit doc, the function to get a user's copilot details is done with

octokit.rest.copilot.getCopilotSeatDetailsForUser({
  org,
  username,
});

Using this method within this action fails.

To Reproduce

  1. In a repository, create basic action
name: Issue Workflow
on:
  issues:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Run GitHub Script
        uses: actions/github-script@v7
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            console.log(Object.keys(github.rest.copilot))
            console.log(github.rest.copilot.getCopilotSeatDetailsForUser({
              org: "MyOrg",
              username: "MyUsername",
            }));
  1. Trigger the action with an issue
  2. The output is
 [
  'addCopilotForBusinessSeatsForTeams',
  'addCopilotForBusinessSeatsForUsers',
  'cancelCopilotSeatAssignmentForTeams',
  'cancelCopilotSeatAssignmentForUsers',
  'getCopilotOrganizationDetails',
  'getCopilotSeatAssignmentDetailsForUser',
  'listCopilotSeats'
]
TypeError: github.rest.copilot.getCopilotSeatDetailsForUser is not a function
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:16), <anonymous>:4:33)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35425:12)
    at main (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35522:26)
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35497:1
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35553:3
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35556:12)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)

Expected behavior
The documented function getCopilotSeatDetailsForUser should work, as it does locally.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: macOS
  • Browser Firefox
  • Version 125

Additional context
(I'm not sure if the problem comes from here specifically, but because the same code works locally but not within this action, it's my first hunch)

Activity

  1. changed the title [-]Octokit's `octokit.rest.copilot.getCopilotSeatDetailsForUser` is renamed/unavailable[/-] [+]Update octokit dependency to match online documentation[/+] on May 16, 2024
  2. joshmgross commented on May 16, 2024

    @joshmgross
    Contributor

    This will require updating @actions/github in https://github.com/actions/toolkit first, as that's pulling in Octokit.

  3. randallt21 commented on Jun 11, 2024

    @randallt21

    Any update on bumping the dependencies to be consistent with latest Octokit?

    Getting a similar error for a different command that would be resolved when this consistency is provided.

    TypeError: github.rest.repos.createOrUpdateCustomPropertiesValues is not a function
        at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:[16](https://github.com/helloextend/backend-service-template/actions/runs/9470274375/job/26090774539#step:3:17)), <anonymous>:3:25)
        at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35425:12)
        at main (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35522:26)
        at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35497:1
        at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35553:3
        at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35556:12)
        at Module._compile (node:internal/modules/cjs/loader:1358:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
        at Module.load (node:internal/modules/cjs/loader:1[20](https://github.com/helloextend/backend-service-template/actions/runs/9470274375/job/26090774539#step:3:21)8:32)
        at Module._load (node:internal/modules/cjs/loader:1024:12)
    

    script is:

    github.rest.repos.createOrUpdateCustomPropertiesValues({
    	owner: context.repo.owner,
    	repo: context.repo.repo,
    	properties: ${{ fromJson(inputs.properties) }}
    })
    
  4. philthethrill99 commented on Feb 18, 2025

    @philthethrill99

    Any news on this issue. Should we use something else since it's been almost a year since the octokit dependency has not been updated?

    Thanks

  5. joshmgross commented on Feb 26, 2025

    @joshmgross
    Contributor

    My plan is to include Octokit updates with v8 - #556.

    We're still stuck with @actions/github which hasn't been updated though.

  6. Jiri-Stary commented on Mar 28, 2025

    @Jiri-Stary

    Please update, there are also some other functions that are missing like

    TypeError: github.rest.repos.getCustomPropertiesValues is not a function

  7. mikeharder commented on Feb 26, 2026

    @mikeharder

    Any updates? The dependencies are now exposed to this vulnerability:

    $ npm i github:actions/github-script
    $ npm audit
    
    undici  <6.23.0
    Severity: moderate
    Undici has an unbounded decompression chain in HTTP responses on Node.js Fetch API via Content-Encoding leads to resource exhaustion - https://github.com/advisories/GHSA-g9mf-h72j-4rw9
    fix available via `npm audit fix`
    node_modules/undici
      @actions/github  6.0.0 - 8.0.0
      Depends on vulnerable versions of @actions/http-client
      Depends on vulnerable versions of undici
      node_modules/@actions/github
      @actions/http-client  2.2.0 - 3.0.1
      Depends on vulnerable versions of undici
      node_modules/@actions/http-client
    
    3 moderate severity vulnerabilities
    
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

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions