Skip to content

Commit caddeec

Browse files
authored
Merge pull request #5 from DeviesDevelopment/check-trigger-event
Only run action if the event is pull_request
2 parents 40ec00c + 3fa9861 commit caddeec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ runs:
1212
id: duration
1313
with:
1414
script: |
15+
if (context.eventName != 'pull_request') {
16+
proccess.exit(0)
17+
}
1518
const currentTime = new Date().getTime();
1619
const currentRun = await github.rest.actions.getWorkflowRun({
1720
owner: context.repo.owner,
@@ -47,7 +50,6 @@ runs:
4750
outputMessage = '🕒 Workflow \"' + context.workflow + '\" took ' + (currentRunDurationInMillis / 1000) + 's which is ' + outcome + ' with ' + Math.abs(diffInSeconds) + 's (' + Math.abs(percentageDiff) + '%) compared to latest run on master/main.'
4851
}
4952
50-
console.log(outputMessage)
5153
github.rest.issues.createComment({
5254
issue_number: context.issue.number,
5355
owner: context.repo.owner,

0 commit comments

Comments
 (0)