Failed to push after syncing a fork


I am new to Github. I followed the Git manual to fork and sync a repo. I successfully merged the changes from the forked repo to my branch.

However, when I tried to push my branch to Github, I kept getting the following error:

! [remote rejected]     dG -> dG (refusing to allow an OAuth App to create or update workflow `.github/workflows/dependencies/` without `workflow` scope)
error: failed to push some refs to ''

I am not sure what went wrong. My git remote looks like this

origin  (fetch)
origin  (push)
upstream (fetch)
upstream (push)

I am using git version 2.20.1 on MacOS 10.14.5.

Thanks a lot if anyone can help me solve this. Please let me know if you need more info.

The error message indicates that something is wrong with the access token you’re using for authentication, specifically the workflow scope (scroll down a little, it’s in the table) is missing. You’ll probably have to create a new token to replace your current one.

would you please tell me how to create a new token? Is it related to the SSH keys?

Access tokens are an alternative to SSH keys: SSH keys are used when you access a repository over SSH, tokens when you use HTTPS. The remote URLs you posted above are HTTPS. If you already have SSH keys set up changing the URLs to SSH is probably the easiest solution.

Documentation on creating tokens is here. Based on that error I assume you’ll need the workflow scope in addition to repo as mentioned in that description. I’m afraid I can’t tell you how to configure the token locally (I use SSH instead), but you mentioned using MacOS, so maybe the help entry on using the OSX Keychain could be useful?