我正在尝试让 GitHub CI
这种格式有什么问题吗? 我也有这样的问题
工作流程文件无效 第 8 行的 yaml 语法有错误
name: Chart project CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
check-links:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
steps:
uses: actions/checkout@v3
- name: Starting Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install modules
- run: npm install
- name: build project
- run: npm build
- name: unit test
- run: npm test
存在一些缩进和语法问题。请在下面找到正确的代码。您可以在这里找到示例运行。 链接
name: Test CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check-links:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
steps:
- uses: actions/checkout@v3
- name: Starting Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install modules
run: npm install
- name: build project
run: npm build
- name: unit test
run: npm test
现在,人们可以简单地使用 ChatGPT 来完成此类任务,而不是使用格式化工具。希望这有帮助!