mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-09 18:23:57 +09:00
Fix: skip paths check on tag push events in workflows (#34602)
## Summary Fix skipping of `paths` condition in workflows triggered by tag push events. ## Details - Ensure workflows triggered by tag pushes bypass the `paths` filter check. - Prevent incorrect skipping of workflows due to `paths` conditions on tag pushes. - Added and updated unit tests to verify correct behavior.
This commit is contained in:
@ -313,6 +313,10 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
|
||||
matchTimes++
|
||||
}
|
||||
case "paths":
|
||||
if refName.IsTag() {
|
||||
matchTimes++
|
||||
break
|
||||
}
|
||||
filesChanged, err := commit.GetFilesChangedSinceCommit(pushPayload.Before)
|
||||
if err != nil {
|
||||
log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
|
||||
@ -326,6 +330,10 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
|
||||
}
|
||||
}
|
||||
case "paths-ignore":
|
||||
if refName.IsTag() {
|
||||
matchTimes++
|
||||
break
|
||||
}
|
||||
filesChanged, err := commit.GetFilesChangedSinceCommit(pushPayload.Before)
|
||||
if err != nil {
|
||||
log.Error("GetFilesChangedSinceCommit [commit_sha1: %s]: %v", commit.ID.String(), err)
|
||||
|
Reference in New Issue
Block a user