LoginSignup
15
7

More than 1 year has passed since last update.

GitHub Actionsの編集ができなくなったときの対応方法 (トークン認証の設定方法)

Last updated at Posted at 2020-12-23

エラーについて

GitHub Actionsのワークフローのファイル編集を行い、pushしようとしたところ次のエラーが発生した。

 ! [remote rejected] (ブランチ名) -> (ブランチ名) (refusing to allow an OAuth App to create or update workflow `(ワークフローのファイル名)` without `workflow` scope)

前提

環境はMacでGit CLIを使用。リポジトリURLの指定はHTTPS。

対応方法

キーチェーンから既存の認証情報を削除

  1. キーチェーンアクセスを開く
  2. 名前がgithub.comとなっている項目を削除する

GitHubのユーザ名をURLに指定

  1. .git/configを開く
  2. github.comの前にユーザ名@を追加する

パーソナルアクセストークンを発行

  1. https://github.com/settings/tokens にアクセス
  2. Personal access tokensを選択
  3. Generate new tokenを選択
  4. workflowにチェックを入れる
  5. Generate Tokenを選択
  6. 発行されたトークンをメモする

トークンのキャッシュを設定

  1. こちらの指示に従いキャッシュの設定を行う

普通にpush

  1. git pushを実行する
  2. パスワードを聞かれるので発行されたトークンを入力する
15
7
1

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
15
7