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.
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:
echo "GH CLI Auth"
gh auth login --with-token < ${{ secrets.GITHUB_TOKEN }}
echo "Create PR"
gh pr create --reviewer myhandle --title "Show Notes ${{ env.NEWFILE_PATH }}" --body "Show Notes ${{ env.NEWFILE_PATH }}"
But I'm getting an error.
GH CLI Auth
/home/runner/work/_temp/<GUID_CENSORED>.sh: line 13: ***: No such file or directory
Error: Process completed with exit code 1.
I am giving the GitHub Token write access to the code and pull-requests.
permissions:
contents: write
pull-requests: write
gh cli
in. Once I moved that, as you pointed out it worked. Thanks! – Phyliciaphylis