Github报错返回错误代码128,请问该怎么做?

问题描述

在Github Action中返回了

Error: The deploy step encountered an error: The process '/usr/bin/git' failed with exit code 128 ❌
Deployment failed! ❌

尝试过哪些方法

1.

更改Token,我使用了一个具有全部权限的Token

2.

在Fork pull request workflows from outside collaborators中
使用Require approval for first-time contributors who are new to GitHub

在Workflow permissions中
使用Read and write permissions
并勾选Allow GitHub Actions to create and approve pull requests

相关代码

name: Build and Deploy
on:
  push:
    branches:
      - main
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
        with:
          persist-credentials: false

      - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
        run: |
          npm install
          npm run build
      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@3.6.2
        with:
          GITHUB_TOKEN: ${{ secrets.All }}
          BRANCH: gh-pages # The branch the action should deploy to.
          FOLDER: dist # The folder the action should deploy.
          CLEAN: true # Automatically remove deleted files from the deploy branch

具体情况就是这样,非常感谢大家的帮助
非常感谢来自MrBigShot的回复,现在还是无法实现正常运行,在此处补充几张有关最新进展的图片。
Action:

build.yml:

Secret:

阅读 4.1k
1 个回答

repository not found 可以参考这个 issue,加个权限即可

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: read
  ...
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题