I am using github actions to publish a project to github pages, this is the yml file:
name: Pages
on:
push:
branches:
- main # default branch
jobs:
pages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_TOKEN }}
# If your repository depends on submodule, please see: https://github.com/actions/checkout
submodules: false
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.REPO_TOKEN }}
publish_dir: ./public
when the steps run into Deploy, the github actions shows error:
Action failed with "The process '/usr/bin/git' failed with exit code 128"
I am not sure should I use a organization token or use personal token? why this error happen? The log detail output look like this:
Run peaceiris/actions-gh-pages@v3
[INFO] Usage https://github.com/peaceiris/actions-gh-pages#readme
Dump inputs
Setup auth token
Prepare publishing assets
Setup Git config
Create a commit
Push the commit or tag
/usr/bin/git push origin gh-pages
remote: Permission to RedDwarfTech/blog.poemhub.top.git denied to jiangxiaoqiang.
fatal: unable to access 'https://github.com/RedDwarfTech/blog.poemhub.top.git/': The requested URL returned error: 403
Error: Action failed with "The process '/usr/bin/git' failed with exit code 128"
this is the organization token access config:

issue 742
Settings > Action > General > Workflow Permissions

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With