paths-filter icon indicating copy to clipboard operation
paths-filter copied to clipboard

Trigger flow based on release tag

Open sharmmoh1983 opened this issue 3 years ago • 2 comments

We are trying to trigger filter based on release tag but it is not happening . Do you have a working sample . I saw similar issue posted but I was looking for specific example

on:
  push:
    tags:
       - 'prod-v[0-9]+.[0-9]+.[0-9]+'

 - uses: dorny/paths-filter@v2
        id: filter
        with:
          base: main

sharmmoh1983 avatar Mar 22 '22 20:03 sharmmoh1983

I guess that you're placing your prod-v* tags on main branch.

I've faced a similar problem where the tag is place on the "base" branch (e.g ci/fix-fail-behavior in the example below): 2022-10-28_15-37

There I've seen that path-filter is checking the files changed between the top of the base branch and the tag. Unfortunately, the same commit is referenced by HEAD and the tag, since I've pushed the tag after the branch, so no changes are found.

The only work-around I can think of is to set the "base" branch to the previous tag, i.e. a tag found with git describe --tags --abbrev=0 HEAD~1.

dod38fr avatar Oct 28 '22 13:10 dod38fr

This work-around is fine provided actions/checkout@v3 was set with fetch-depth: 0.

dod38fr avatar Oct 28 '22 14:10 dod38fr