以下のURLを押す
https://qiita.com/hirothings/items/8b417b2efe2e1c1bc0ac
Read and writeに変更
https://zenn.dev/osawa_koki/articles/a63b96a2707a8f
Organizationアカウントだと上の設定ができない https://github.com/orgs/community/discussions/57244
個別に設定する方がいいらしい https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions
こんな感じ
permissions:
actions: write
checks: write
contents: write
以下の例ではdevelopブランチにpushしようとしていて、developブランチにブランチ保護が付いている。
remote: error: GH006: Protected branch update failed for refs/heads/develop.
remote:
remote: - 2 of 2 required status checks are expected.
To https://github.com/xxx/xxx
! [remote rejected] develop -> develop (protected branch hook declined)
error: failed to push some refs to 'https://github.com/xxx/xxx'