In a new Github repo I have added a workflow file. I can edit that file in the online editor.
But when I clone the repo, change the workflow and then try to push, I am getting:
$ LANG=C git push origin HEAD
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 406 bytes | 406.00 KiB/s, done.
Total 5 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/...git
! [remote rejected] HEAD -> main (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/myfirstaction.yml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/...git'
I have created Github repos before and using them frequently from the command line to push, pull, etc. and have never come across this problem.
I created a new Access Token with “workflow” box checked with the github web interface as explained in https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens , and saved the token in
$HOME/.get-credentials
but with no avail.
I also found https://github.com/orgs/community/discussions/26254 which says to run
$ git remote add origin https://<key>@github.com/<user>/<repo>.git
And then it works, but my feel ist that the private key is dislocated in .git/config
?