- name: Generate API module
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone https://user:$GITHUB_TOKEN@github.com/owner/my-repo # This works
cd my-repo
git config user.name "user"
git config user.email "dev@example.com"
git checkout -b api-version-$COMMIT
touch new-file.sh
git add new-file.sh
git commit -m "Add new file"
git remote -v # Prints:
# origin ***github.com/owner/my-repo.git (fetch)
# origin ***github.com/owner/my-repo.git (push)
git push --set-upstream origin api-version-$COMMIT # This does not work
git push --set-upstream https://user:$GITHUB_TOKEN@github.com/owner/my-repo api-version-$COMMIT # This does not work either
我可以成功克隆所有者/存储库。我可以检出新分支,添加文件并提交更改。问题发生在我尝试将更改推送到上游时。完全不起作用,并且我会收到此错误:
remote: Repository not found.
fatal: repository 'https://github.com/owner/my-repo/' not found
我猜想这可能与身份验证有关。 GITHUB_TOKEN
是个人访问令牌,拥有所有可能的权限。
怎么回事?