mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-10 00:26:14 +02:00
Fix the bug when getting files changed for pull_request_target event (#26320)
Follow #25229 Copy from https://github.com/go-gitea/gitea/pull/26290#issuecomment-1663135186 The bug is that we cannot get changed files for the `pull_request_target` event. This event runs in the context of the base branch, so we won't get any changes if we call `GetFilesChangedSinceCommit` with `PullRequest.Base.Ref`.
This commit is contained in:
1 parent
5db4c8db93
commit
9a8af92577
4 files changed
+77
-13
No files matched your search
@@ -125,7 +125,7 @@ func TestDetectMatched(t *testing.T) {
|
||||
evts, err := GetEventsFromContent([]byte(tc.yamlOn))
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, evts, 1)
|
||||
assert.Equal(t, tc.expected, detectMatched(tc.commit, tc.triggedEvent, tc.payload, evts[0]))
|
||||
assert.Equal(t, tc.expected, detectMatched(nil, tc.commit, tc.triggedEvent, tc.payload, evts[0]))
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user