Skip to content

Cannot call github.rest.actions.reRunWorkflow #268

Closed

Description

@plazum

Describe the bug
I can't call github.rest.actions.reRunWorkflow. I get the following message when I call it.

TypeError: github.rest.actions.reRunWorkflow is not a function

To Reproduce
Just simply call github.rest.actions.reRunWorkflow.

Expected behavior
github.rest.actions.reRunWorkflow works as it should.

Additional context
I use the following code to examine what there are in github.rest.actions.

for (let i in github.rest.actions)
    console.log(i);

And I get the following output. (Logs here.)

Details

addSelectedRepoToOrgSecret
approveWorkflowRun
cancelWorkflowRun
createOrUpdateEnvironmentSecret
createOrUpdateOrgSecret
createOrUpdateRepoSecret
createRegistrationTokenForOrg
createRegistrationTokenForRepo
createRemoveTokenForOrg
createRemoveTokenForRepo
createWorkflowDispatch
deleteArtifact
deleteEnvironmentSecret
deleteOrgSecret
deleteRepoSecret
deleteSelfHostedRunnerFromOrg
deleteSelfHostedRunnerFromRepo
deleteWorkflowRun
deleteWorkflowRunLogs
disableSelectedRepositoryGithubActionsOrganization
disableWorkflow
downloadArtifact
downloadJobLogsForWorkflowRun
downloadWorkflowRunAttemptLogs
downloadWorkflowRunLogs
enableSelectedRepositoryGithubActionsOrganization
enableWorkflow
getAllowedActionsOrganization
getAllowedActionsRepository
getArtifact
getEnvironmentPublicKey
getEnvironmentSecret
getGithubActionsPermissionsOrganization
getGithubActionsPermissionsRepository
getJobForWorkflowRun
getOrgPublicKey
getOrgSecret
getPendingDeploymentsForRun
getRepoPermissions
getRepoPublicKey
getRepoSecret
getReviewsForRun
getSelfHostedRunnerForOrg
getSelfHostedRunnerForRepo
getWorkflow
getWorkflowRun
getWorkflowRunAttempt
getWorkflowRunUsage
getWorkflowUsage
listArtifactsForRepo
listEnvironmentSecrets
listJobsForWorkflowRun
listJobsForWorkflowRunAttempt
listOrgSecrets
listRepoSecrets
listRepoWorkflows
listRunnerApplicationsForOrg
listRunnerApplicationsForRepo
listSelectedReposForOrgSecret
listSelectedRepositoriesEnabledGithubActionsOrganization
listSelfHostedRunnersForOrg
listSelfHostedRunnersForRepo
listWorkflowRunArtifacts
listWorkflowRuns
listWorkflowRunsForRepo
removeSelectedRepoFromOrgSecret
reviewPendingDeploymentsForRun
setAllowedActionsOrganization
setAllowedActionsRepository
setGithubActionsPermissionsOrganization
setGithubActionsPermissionsRepository
setSelectedReposForOrgSecret
setSelectedRepositoriesEnabledGithubActionsOrganization

Activity

  1. added
    question
    dependencies
    on Jun 21, 2022
  2. joshmgross commented on Jun 21, 2022

    @joshmgross
    Contributor

    We may need to update our version of Octokit.

    In the meantime, you can use github.request directly

    await github.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun', {
      owner: 'OWNER',
      repo: 'REPO',
      run_id: 'RUN_ID'
    })

    https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-workflow

  3. plazum commented on Jun 21, 2022

    @plazum
    Author

    We may need to update our version of Octokit.

    In the meantime, you can use github.request directly

    await github.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun', {
      owner: 'OWNER',
      repo: 'REPO',
      run_id: 'RUN_ID'
    })

    https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-workflow

    Thanks. That's exactly what I'm doing now and in the past several months.

    Wait, I just find that it's not your fault. There is no octokit.rest.actions.reRunWorkflow in Octokit!

    I try to use Octokit as how its documentation says,

    import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";

    And there is still no reRunWorkflow in it.

    And then I find this. octokit/rest.js#130

    So it is https://octokit.github.io/rest.js/ that is outdated.

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

    dependenciesgood first issuequestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions