I have a bunch of repos that use Azure Pipelines for CI/CD, which I'm now trying to port to Github Actions. This is the first one I'm working on: https://github.com/Azure/AzureAuth/tree/fix-ghaction
I've got it 99% working but I'm getting a weird authentication error on one step. The repo is mirrored to another org (cloudyr), and I use this step to do the mirroring:
- name: Copy to Cloudyr
if: runner.os == 'Linux'
env:
token: "${{ secrets.ghPat }}"
run: |
export CLOUDYR_REPO=$(echo $GITHUB_REPOSITORY | sed "s/Azure/cloudyr/")
git push --prune https://[email protected]/${CLOUDYR_REPO}.git +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*
This retrieves a PAT from the repo secrets, and does a git push. It was working perfectly well with Azure Pipelines, but now it fails with the following error:
Run export CLOUDYR_REPO=$(echo $GITHUB_REPOSITORY | sed "s/Azure/cloudyr/")
remote: Permission to cloudyr/AzureAuth.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/cloudyr/AzureAuth.git/': The requested URL returned error: 403
Error: Process completed with exit code 128.
Can anyone explain what's causing this, and how to fix it? I have admin access to both the Azure/AzureAuth and cloudyr/AzureAuth repos. I've also checked that the PAT is valid.
Failed log is here: https://github.com/Azure/AzureAuth/runs/1228152900?check_suite_focus=true