我们将 GitHub Actions 用于我们项目的多模块 Maven CI 构建,地址为 https://github.com/ibm/fhir .
我们有:
我发现我可以通过定义多个工作流并使用内置的
on.pull_request.paths
来完成这样的事情。属性(property)记录在:https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths我想知道的是我是否/如何能在
job
上完成类似的事情或 step
等级。我发现作业支持基于 https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idif 的条件执行但我不知道是否有任何东西可以帮助获得类似于 on.pull_request.paths
的行为特征。假设没有,有没有人找到一个行动来帮助解决这个问题?或者也许有人可以指出我的实现
on.pull_request.paths
特征?
最佳答案
社区论坛上的这篇文章可能会有所帮助。
https://github.community/t5/GitHub-Actions/What-happened-to-github-event-head-commit-modified/m-p/37736#M3066
那里的原始海报有类似的问题,他们创建了以下操作来确定是否对路径列表进行了修改。我不确定这是否适用于 on: pull_request
,但你可以试试看。
https://github.com/marketplace/actions/path-watcher-action
来自 path-watcher-action
的示例存储库:
on: [push]
jobs:
job:
runs-on: ubuntu-latest
steps:
- id: modified
uses: pheel/path-watcher-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths: 'dir1/**/*,dir2/**/*'
- if: steps.modified.outputs.modified
run: echo "Hey some change happened in one of your watched paths!"
关于maven - 基于更新路径的条件作业和步骤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58808690/