Skip to content

[BUG]: position marked necessary in createReview while it's not #614

Description

@bnjbvr

What happened?

In the createReview method, the comment's position is marked as necessary according to TypeScript's typings, but the documentation states it's not: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#create-a-review-for-a-pull-request

Versions

  "dependencies": {
    "@actions/core": "^1.2.6",
    "@actions/exec": "^1.0.4",
    "@actions/github": "^4.0.0"
  },
  "devDependencies": {
    "@types/jest": "^26.0.10",
    "@types/node": "^14.6.1",
    "@typescript-eslint/eslint-plugin": "^3.10.1",
    "@typescript-eslint/parser": "^3.10.1",
    "@vercel/ncc": "^0.24.0",
    "eslint": "^7.7.0",
    "eslint-config-sentry": "^1.43.0",
    "eslint-plugin-jest": "^23.20.0",
    "eslint-plugin-prettier": "^3.1.4",
    "husky": "^4.2.5",
    "jest": "^26.4.2",
    "jest-circus": "^26.4.2",
    "js-yaml": "^3.13.1",
    "lint-staged": "^10.2.13",
    "prettier": "^2.1.1",
    "ts-jest": "^26.3.0",
    "typescript": "^4.0.2"
  }

node is v19.5

Relevant log output

src/createReviewCommentsFromPatch.ts:74:7 - error TS2322: Type '{ path: string; body: string; side: string; start_side: string; start_line: number | undefined; line: number; }[]' is not assignable to type 'PullsCreateReviewParamsComments[]'.
  Property 'position' is missing in type '{ path: string; body: string; side: string; start_side: string; start_line: number | undefined; line: number; }' but required in type 'PullsCreateReviewParamsComments'.

74       comments,
         ~~~~~~~~

  node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts:39740:5
    39740     position: number;
              ~~~~~~~~
    'position' is declared here.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

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

    Status: Up for grabsIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documentedhacktoberfestIssues for participation in Hacktoberfest

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions