下記のようにgh-pages deployのworkflowを作っていた。

jobs:
  gh-pages-deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3.1
        bundler-cache: true
    - name: Jekyll Build
      run: bundle exec jekyll build
    - name: Deploy
      uses: peaceiris/actions-gh-pages@v3
      with:
        personal_token: $
        publish_dir: ./_site

これをそのまま走らせると下記のエラーで止まる。

remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/your/repo/': The requested URL returned error: 403

Writeアクセスがないと言うエラー。

この場合、 permissionsでwriteを付与してやるでOK.

permissions:
  contents: write
jobs:
  gh-pages-deploy:
    ....

これでbuild成功!!

参考