I have two repos that are identical to each other. The private repo has a few self-hosted runners that I did not want on my public repo. I am attempting to automate pushing to the public repo from the private one using an action, but I am having issues pushing. Currently I am using these set of commands to try and push:
git config --local user.name "Github Action"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git checkout `echo $GITHUB_REF | cut -d'/' -f3-`
git push https://$USERNAME:$REPO_KEY@github.com/$REPO_PATH.git $GITHUB_REF
Where “$USERNAME” and “$REPO_KEY” are secrets that are passed as environment variables. $USERNAME is my Github username and $REPO_KEY is a personal access token. This is the error that I keep getting:
remote: Permission to chand1012/multipass-vm-action.git denied to github-actions[bot].
Is there a way to give “github-actions” push permissions for just that repository?