title: How do you authenticate with Github and create PRs using GitHub cli (gh) in a GitHub Action?
body: <p>In a GitHub action, I create a file with a script. Then I can use git create a branch, add the file, commit the file and push the branch to the repo. All using git.</p>
  <p>I then want to create a PR from within my action so I'm using GH CLI.
  In my steps this is the PR relate part:</p>
  <pre><code>echo &quot;GH CLI Auth&quot;
  gh auth login --with-token &lt; ${{ secrets.GITHUB_TOKEN }}
  echo &quot;Create PR&quot;
  gh pr create --reviewer myhandle --title &quot;Show Notes ${{ env.NEWFILE_PATH }}&quot; --body &quot;Show Notes ${{ env.NEWFILE_PATH }}&quot;
  </code></pre>
  <p>But I'm getting an error.</p>
  <pre><code>GH CLI Auth
  /home/runner/work/_temp/&lt;GUID_CENSORED&gt;.sh: line 13: ***: No such file or directory
  Error: Process completed with exit code 1.
  </code></pre>
  <p>I am giving the GitHub Token write access to the code and pull-requests.</p>
  <pre><code>permissions:
    contents: write
    pull-requests: write
  </code></pre>
  <h2>I'm stumped. Thanks for the help!</h2>