LoginSignup
0

More than 1 year has passed since last update.

Github Actionsの設定ファイル作成後にgit pushが失敗する時の対処方法

Posted at

環境

macOS Monterey 12.3.1

エラー内容

Github Actionsのワークフローファイルを作成後、
git pushすると以下のエラーが発生した。

 ! [remote rejected] HEAD -> (ブランチ名) (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/(ファイル名).yml` without `workflow` scope)

原因

Githubのパーソナルトークン設定で'workfrow'を許可していなかった。

対処方法

1. トークンを再生成する

Github → Settings → Developer Settings → Personal Access Tokens
→ Generate new token

'workflow'、その他必要な項目にチェックを入れて再生成する。
(既存のトークンに追加も出来ると思います)
公式docs: https://docs.github.com/ja/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

2. 既存の認証情報を削除する

キーチェーンアクセス → "github.com"を削除

3. 再度 git push する

Githubユーザー名とトークンを求められるので入力
→ 無事にpush出来ました。

参考記事

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0