【发布时间】:2021-04-28 18:00:14
【问题描述】:
我是 Gatsby 的新手,今天刚刚为我的网站尝试了 GH Actions 工作流程。我在构建阶段看到了这个错误:
error "gatsby-source-github-api" 在运行 sourceNodes 生命周期:令牌未定义
我正在使用它来将我的 Github 上的所有 repos 拉入网站。
到目前为止我所尝试的:
- 检查了 Github 个人访问令牌
- 构建正在本地运行
版本:
“gatsby-source-github-api”:“^0.2.1”“gatsby”:“^2.26.1”
这是我的 node.js.yml GH Actions 工作流文件:
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [13.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
PS:我使用 .env 文件来保存插件“gatsby-source-github-api”所需的令牌值。它在我的 .gitignore 文件中。那么这意味着它没有发送到 GH,因此找不到它?
【问题讨论】: