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



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

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

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.

它以这个错误失败

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! ❌

我也尝试过";"公共";作为文件夹,但它也失败了,因为它说它不存在(尽管我的回购确实有那个文件夹(

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

除此之外,我看到了两件可能需要检查的事情:

  1. 您在第一个操作中引用了分支main,但在第二个操作中则引用了master。这些是否指向同一个存储库?如果是这样的话,我认为分支名称应该是相同的。

  2. 对于v3组件,ACCESS_TOKEN的文档暗示您需要使用存储在机密中的生成的个人访问令牌。这就是我在使用此操作时使用的方法,尽管我正在将其推送到另一个存储库,所以无论如何都是必须的。

不过我很早以前就转到了v4。

最新更新