Skip to content

Commit 7b6b113

Browse files
authored
Fix commit SHA for workflow_run (#158)
* Fix commit SHA for workflow_run * Change to not use pull_request
1 parent c1c1738 commit 7b6b113

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dist/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17937,12 +17937,12 @@ const main = async () => {
1793717937
} else if (eventName === 'push') {
1793817938
options.commit = payload.after;
1793917939
options.head = context.ref;
17940-
} else if (
17941-
eventName === 'workflow_dispatch' ||
17942-
eventName === 'workflow_run'
17943-
) {
17940+
} else if (eventName === 'workflow_dispatch') {
1794417941
options.commit = context.sha;
1794517942
options.head = context.ref;
17943+
} else if (eventName === 'workflow_run') {
17944+
options.commit = payload.workflow_run.head_sha;
17945+
options.head = payload.workflow_run.head_branch;
1794617946
}
1794717947

1794817948
if (options.reportOnlyChangedFiles) {

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ const main = async () => {
125125
} else if (eventName === 'push') {
126126
options.commit = payload.after;
127127
options.head = context.ref;
128-
} else if (
129-
eventName === 'workflow_dispatch' ||
130-
eventName === 'workflow_run'
131-
) {
128+
} else if (eventName === 'workflow_dispatch') {
132129
options.commit = context.sha;
133130
options.head = context.ref;
131+
} else if (eventName === 'workflow_run') {
132+
options.commit = payload.workflow_run.head_sha;
133+
options.head = payload.workflow_run.head_branch;
134134
}
135135

136136
if (options.reportOnlyChangedFiles) {

0 commit comments

Comments
 (0)