触发 GitHub Actions 中已提交的工作单元?

huangapple go评论68阅读模式
英文:

How to trigger the committed units in GitHub Actions?

问题

如果.mdl和.tpt文件已提交到代码库,特定的单元还有一个批处理文件需要触发。有人知道如何解决这个问题吗?

路径:

src/model/units/.mdl
tests/Impl/Unittest/units/.tpt
tests/Impl/Unittest/units/.bat

我需要脚本,来解决这个问题以及要做什么。

英文:

If .mdl and .tpt files are committed to the repository, a specific unit has a batch file also that needs to be triggered. Does anyone know how to resolve this issue?

Paths:

src/model/units/.mdl
tests/Impl/Unittest/units/.tpt
tests/Impl/Unittest/units/.bat

I need script, how to do and what to do for this issue.

答案1

得分: 1

根据官方文档的说明,您可以使用paths语法来实现您想要的效果:

on:
  push:
    paths:
      - '**.mdl'
      - '**.tpt'
      - '**.bat'

这个工作流将在每次将.mdl.tpt.bat文件推送到存储库时触发(适用于任何分支)。

请注意,这个实现也可以用于pull_request事件。

英文:

As explained in the official documentation, you could use the paths syntax to achieve what you want:

on:
  push:
    paths:
      - '**.mdl'
      - '**.tpt'
      - '**.bat'

This workflow will trigger every time a .mdl, .tpt or .bat file is pushed to the repository (for any branch).

Note that this implementation could also work with pull_request events.

huangapple
  • 本文由 发表于 2023年6月12日 16:53:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76454988.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定