首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Github操作在Fetch API上生成和部署失败

Github操作在Fetch API上生成和部署失败
EN

Stack Overflow用户
提问于 2021-05-07 19:38:42
回答 1查看 448关注 0票数 0

我使用这个GitHub操作https://github.com/JamesIves/fetch-api-data-action来获取和保存由API获取的数据:

这是我对两个操作的配置,一个操作获取API,然后构建和部署以保存从API获取的.json。

代码语言:javascript
复制
name: Refresh Feed
on: [push]
jobs:
  refresh-feed:
    runs-on: ubuntu-latest
    steps:
      - name: Fetch API Data 
        uses: JamesIves/fetch-api-data-action@releases/v1
        with:
          ENDPOINT: https://data
          BRANCH: master # Pushes the updates to the master branch.


      - name: Build and Deploy 
        uses: JamesIves/github-pages-deploy-action@4.1.1
        with:
          branch: master # The branch the action should deploy to.
          folder: . # The folder the action should deploy.

如果出现此错误,则失败

代码语言:javascript
复制
Run JamesIves/github-pages-deploy-action@4.1.1
9

10
    GitHub Pages Deploy Action 
11

12
     Getting Started Guide: https://github.com/marketplace/actions/deploy-to-github-pages
13
    ❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
14
     Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues
15

16
     Maintained by James Ives: https://jamesiv.es
17
     Support: https://github.com/sponsors/JamesIves
18
Checking configuration and starting deployment… 
19
Deploying using Deploy Token… 
20
Configuring git…
21
/usr/bin/git config user.name abcname
22
fatal: not in a git directory
23
Error: There was an error initializing the repository: The process '/usr/bin/git' failed with exit code 128 ❌
24
Deployment failed! ❌

我也尝试了“公共”作为文件夹,但它也失败了,因为它说它不存在(我的回购确实有那个文件夹)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-07 19:50:24

您正在使用该操作的旧版本。也许尝试转到v4,它以不同的方式处理这些参数。如果要回推到同一个存储库,甚至不需要传递令牌。

除此之外,我认为还有两件事需要检查:

  1. 您在第一个操作中引用分支main,而在第二个操作中引用master。它们指向同一个存储库吗?如果是这样的话,我认为分支的名称将是相同的。

  1. 和v3组件,ACCESS_TOKEN的文档意味着您需要使用存储在机密中的生成的个人访问令牌。这就是我在使用此操作时所使用的操作,尽管我正在将其推送到不同的存储库,因此无论如何都是必须的。

不过,我很久以前就搬到v4了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67440780

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档