我在 ./github/workflows/
中有 3 个目录
在每个目录中,我都有多个工作流程
.yml
文件例如 linters/codeQuality.yml
我的问题是,当发出拉取请求时,只会执行 root 中的工作流文件,而不是这些目录中的工作流文件。我怎么解决这个问题?
最佳答案
您不能从子目录运行工作流:
You must store workflow files in the
.github/workflows
directory of your repository.
来源:
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows
但是,您可以使用复合运行步骤操作 ( documentation )。
.github/workflows/workflow.yaml
[...]
jobs:
myJob:
name: My Job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/linters/codeQuality
[...]
.github/workflows/linters/codeQuality/action.yaml
name: "My composite action"
description: "Checks out the repository and does something"
runs:
using: "composite"
steps:
- run: |
echo "Doing something"
[other steps...]
关于github - 如何从子目录运行多个 GitHub Actions 工作流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64009546/