Github操作-当分支中的特定目录获得更新时,如何触发推送? [英] Github Actions - How do you trigger a push when a specific directory in a branch gets an update?

查看:47
本文介绍了Github操作-当分支中的特定目录获得更新时,如何触发推送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的工作流仅在对特定目录进行了更改时才触发推送.这可能吗,我想念什么?我尝试做类似您在下面看到的操作,但是没有触发.

I want my workflow to trigger on a push only if there are changes made to a specific directory. Is this possible, what am I missing? I tried doing something like what you see below, but it didn't fire the trigger.

name: ABC

on:
  push:
    branches:  [master/my-directory]
  pull_request:
    branches: [ master ]

推荐答案

push 具有名为

push has a property called paths:

name: ABC
on:
  push:
    branches:
      - master
    paths:
      - my-directory/**

这只会在对 my 目录树中的更改进行推送到 master 分支时触发.请参见过滤器模式备忘单,用于所有可能的过滤器模式.

This will only trigger on pushes to the master branch with changes in the my-directory directory tree. See the filter pattern cheat sheet for all possible filter patterns.

这篇关于Github操作-当分支中的特定目录获得更新时,如何触发推送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆