Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

refusing to allow a Personal Access Token to create or update workflow

Tags:

github

Today when I added a workflow and push the code to GitHub remote repo, shows this error:

refusing to allow a Personal Access Token to create or update workflow

This is the full error output:

~/Documents/GitHub/flutter-netease-music on  master ⌚ 12:25:13
$ git push origin master                                                                                                      ‹ruby-2.7.2›
Username for 'https://github.com': username
Password for 'https://[email protected]':
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 12 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (13/13), 1.86 KiB | 1.86 MiB/s, done.
Total 13 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (6/6), completed with 4 local objects.
To https://github.com/jiangxiaoqiang/flutter-netease-music.git
 ! [remote rejected] master -> master (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/main-ios.yml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/jiangxiaoqiang/flutter-netease-music.git'
(base)

I am auth with token and have privillege to modify the repo. Now I could not push using password. When I try to use my password, the error message is:

~/Documents/GitHub/flutter-netease-music on  master ⌚ 12:28:37
$ git push origin master                                                                                                      ‹ruby-2.7.2›
Username for 'https://github.com': username
Password for 'https://[email protected]':
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/jiangxiaoqiang/flutter-netease-music.git/': The requested URL returned error: 403
(base)

Why would this happen and what should I do to fix it?

like image 769
Dolphin Avatar asked Aug 17 '21 04:08

Dolphin


People also ask

How do I use GitHub personal access token?

Under your GitHub user profile (not the repository profile), click the “Settings” link. Scroll down and click the “Developer Settings” link. Click the GitHub “Personal access tokens” link. Click the “Generate new token” link and provide your password again if required.

Is it possible to change the scope of a user's access token?

You can also edit current Personal Access Token to change its scope by including workflow to it. This is exactly what I just did to overcome the issue. @gondadarian. Yes! Thank you. Updating existing user personal access token and adding workflow to it was the most seamless and easiest way to solve this problem.

How do I generate a token for my application?

In your Github account, go to Settings (in your avatar dropdown in the top right-hand corner) If your application is listed, click on its name to edit the settings associated with its token. Make sure workflow is ticked. Click on Update Token to save the change. On the same page, click on Generate Token.

How to modify GitHub actions using workflow scope?

But you need the workflow scope to modify GitHub Actions. In your Github account, go to Settings (in your avatar dropdown in the top right-hand corner) If your application is listed, click on its name to edit the settings associated with its token. Make sure workflow is ticked. Click on Update Token to save the change.

Do I need to create GitHub_token for workflow?

You don't need create Personal Access Token with "workflow", you don';t need create secret GITHUB_TOKEN (it creates auto and can't created manual) For me, it was deleting all github related credentials and logout and back in in the github desktop app. But closest answer by far! Just resolved it!


Video Answer


1 Answers

give workflow privillege when created token in GitHub:

enter image description here

like image 51
Dolphin Avatar answered May 26 '23 03:05

Dolphin