title: How to create an inline review comment in github in the diff view using github actions
body: <p>I have been trying to use github actions to place a comment inline in the pull request diff. I have tried to follow this documentation: <a href="https://docs.github.com/en/rest/reference/pulls#create-a-review-comment-for-a-pull-request" rel="nofollow noreferrer">review-comment-in-diff</a> however nothing seemed to work as expected. The documentation seems to state that you can just use the property <code>position</code>, but other docs say you need <code>commit_id</code> and <code>path</code> for it to work <a href="https://developer.github.com/enterprise/2.2/v3/pulls/comments/#create-a-comment" rel="nofollow noreferrer">create-a-comment</a>. If I do not add <code>commit_id</code> or <code>path</code>, I get an error message that they are missing, if I add it I get a validation error. I will show both below. Note that the first error message also mentions missing <code>in_reply_to</code> and <code>line</code> which according to the documentation is not needed for creating a new comment using <code>position</code>.</p>
  <pre><code>- name: publish line comment curl
          if: contains(env.SCRIPT_OUTPUT, 'FAIL')
          env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          run: |
            curl \
              -X POST \
              -H &quot;Accept: application/vnd.github.v3+json&quot; \
              https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/comments \
              -H &quot;Authorization: token $GITHUB_TOKEN&quot; \
              --data '{  &quot;body&quot;: &quot;blah blah&quot; ,
                      &quot;path&quot;: &quot;SomeDir/SomeFile.json&quot;,
                      &quot;position&quot;: 1
                      }'
  </code></pre>
  <blockquote>
  <p>{
  &quot;message&quot;: &quot;Invalid request.\n\nNo subschema in &quot;oneOf&quot; matched.\n&quot;commit_id&quot; wasn't supplied.\n&quot;in_reply_to&quot; wasn't supplied.\n&quot;position&quot; is not a permitted key.\n&quot;commit_id&quot;, &quot;line&quot; weren't supplied.&quot;,</p>
  </blockquote>
  <pre><code>--data '{  &quot;body&quot;: &quot;blah blah&quot; ,
                      &quot;path&quot;: &quot;SomeDir/SomeFile.json&quot;,
                      &quot;position&quot;: 1,
                      &quot;commit_id&quot;: &quot;${{ github.sha }}&quot;
                      }'
  </code></pre>
  <blockquote>
  <p>&quot;message&quot;: &quot;Validation Failed&quot;,
  &quot;errors&quot;: [
  {
  &quot;resource&quot;: &quot;PullRequestReviewComment&quot;,
  &quot;code&quot;: &quot;custom&quot;,
  &quot;field&quot;: &quot;pull_request_review_thread.end_commit_oid&quot;,
  &quot;message&quot;: &quot;pull_request_review_thread.end_commit_oid is not part of the pull request&quot;</p>
  </blockquote>