Skip to content

Commit 5b5f853

Browse files
authored
[ghactions] Use the Workflow's head SHA only for PRs (#4555)
We should just trust the report in all other cases; it should be correct in general.
1 parent 6b4a4cd commit 5b5f853

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

api/ghactions/notify.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,19 @@ func processBuild(
146146
opts.Page = resp.NextPage
147147
}
148148

149+
var sha string
150+
if *workflowRun.Event == "pull_request" {
151+
sha = *workflowRun.HeadSHA
152+
}
153+
149154
uploader, err := aeAPI.GetUploader(uploaderName)
150155
if err != nil {
151156
return false, fmt.Errorf("failed to get uploader creds from Datastore: %w", err)
152157
}
153158

154159
uploadClient := uc.NewClient(aeAPI)
155160
err = uploadClient.CreateRun(
156-
*workflowRun.HeadSHA,
161+
sha,
157162
uploader.Username,
158163
uploader.Password,
159164
nil,

0 commit comments

Comments
 (0)