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

Fix calling GitHub API (github.api.~ -> github.rest.~) #2116

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

massongit
Copy link
Contributor

@massongit massongit commented Nov 11, 2021

Proposed Changes

https://github.com/github/super-linter/runs/4169311424?check_suite_focus=true#step:11:27

Error: Unhandled error: TypeError: Cannot read property 'issues' of undefined

I replace github.api.~ in the scripts using actions/github-script@v5 with github.rest.~ to fix the above error.

https://github.com/actions/github-script#breaking-changes-in-v5

Version 5 of this action includes the version 5 of @actions/github and @octokit/plugin-rest-endpoint-methods. As part of this update, the Octokit context available via github no longer has REST methods directly. These methods are available via github.rest.* - https://github.com/octokit/plugin-rest-endpoint-methods.js/releases/tag/v5.0.0

For example, github.issues.createComment in V4 becomes github.rest.issues.createComment in V5

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

Copy link
Collaborator

@admiralAwkbar admiralAwkbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix!

@admiralAwkbar admiralAwkbar merged commit e0790b4 into super-linter:main Nov 12, 2021
sarahc23 pushed a commit to 23andMe/super-linter that referenced this pull request May 6, 2022
@massongit massongit deleted the fix_github_script branch September 11, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants