GitHub 使用 Sapper 构建页面失败

GitHub Pages build failure with Sapper

我已经为这个项目苦苦挣扎了一段时间,我已经放弃了一切尝试,只是通过 Sapper/Svelte 和 GitHub 页面部署来了解基础知识,因为我需要这个运行 作为 GitHub 应用程序。我已经阅读了多个教程,现在我尝试尽可能匹配 this example repo,但我在构建和部署时遇到错误。

我在 GitHub 操作选项卡中看到的错误是:

❌ Build and Deploy

Run JamesIves/github-pages-deploy-action@releases/v3

Checking configuration and starting deployment…

Deploying using Access Token…

Configuring git…

##[error]There was an error initializing the repository: The process '/usr/bin/git' failed with exit code 128 ❌

Deployment failed! ❌

其他一切都过去了。我是 Sapper/Svelte 的新手,也是 GitHub 页面的新手,所以如果我遗漏了一些明显的东西,请原谅我。

编辑:

我的 main.yml 文件类似于以下内容:

name: Build and Deploy
on:
  push:
    branches:
      - master
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        persist-credentials: false

    - name: Use Node.js '12.x'
      uses: actions/setup-node@v1
      with:
        node-version: '12.x'
    - run: npm install
    - run: npm run export
    - name: Build and Deploy
      uses: JamesIves/github-pages-deploy-action@releases/v3
      with:
        ACCESS_TOKEN: ${{ secrets.<my secret that definitely exists on GitHub }}
        BRANCH: gh-pages
        FOLDER: __sapper__/export/<my repo>

这是从 https://gavinr.com/svelte-sapper-github-pages-actions/

复制的

Craig 的评论为我指明了正确的方向。问题出在我的访问令牌的权限上。我需要确保我拥有完整的回购访问权限才能构建该应用程序。