I keep getting this error:
pull request create failed: GraphQL: Resource not accessible by integration (createPullRequest)
Error: Process completed with exit code 1.
Here is my workflow:
name: Update from upstream
on:
schedule:
- cron: '0 0 * * *' # Runs every midnight
push:
branches:
- master # Change to your default branch if different
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Add upstream remote
run: git remote add upstream https://github.com/skypilot-org/skypilot.git
- name: Fetch upstream
run: git fetch upstream
- name: Checkout new empty branch
id: date
run: |
BRANCH_NAME=$(date +%Y-%m-%d-%H-%M-%S)
git switch --orphan $BRANCH_NAME
echo "::set-output name=date::$BRANCH_NAME"
- name: Merge upstream changes
run: git merge upstream/master
- name: Push to remote branch
run: git push -u origin `date +%Y-%m-%d-%H-%M-%S`
- name: Create pull request
run: gh pr create -B master -H `date +%Y-%m-%d-%H-%M-%S` --title 'Merge master into `date +%Y-%m-%d-%H-%M-%S`' --body 'Created by Github action'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Workflow Permission granted
I did not expect this error to happen since I have included the GITHUB_TOKEN
in the environment when I’m using the GitHub CLI and I also made sure to check the box for Allow GitHub Actions to create and approve pull requests
in my repo’s Workflow Permission Settings.
New contributor
Siri Suntichaiwakin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.