Skip to content

octokit.rest.actions not available #345

Open
@tcarac

Description

@tcarac

Describe the bug

TypeError: github.rest.actions.getEnvironmentVariable is not a function
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15099:16), <anonymous>:3:43)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15100:12)
    at main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15[19](https://github.com/g2crowd/actions_test/actions/runs/4372190858/jobs/7648818737#step:2:20)8:26)
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:15175:1
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:15230:3
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15233:12)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:8[22](https://github.com/g2crowd/actions_test/actions/runs/4372190858/jobs/7648818737#step:2:23):12)
Error: Unhandled error: TypeError: github.rest.actions.getEnvironmentVariable is not a function

To Reproduce

jobs:
  check-env:
    name: Validate Environment Configuration
    environment: staging
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v6
        with:
          script: |
            const sidecar = await github.rest.actions.getEnvironmentVariable({
              repository_id: context.repo.id,
              environment_name: context.payload.client_payload.environment,
              name: 'SIDECAR'
            });
            console.log(JSON.stringify(sidecar));
            return;

Expected behavior
github.rest.actions.getEnvironmentVariable should be defined as documented in octokit/rest

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filegood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions