File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,25 @@ jobs:
1919 uses : actions/github-script@v6
2020 with :
2121 script : |
22- const commentBody = context.payload.comment.body;
22+ let body = "";
23+ if (context.payload.issue && context.eventName === "issues") {
24+ body = context.payload.issue.body || "";
25+ console.log("Checking issue body...");
26+ } else if (context.payload.comment && context.eventName === "issue_comment") {
27+ body = context.payload.comment.body || "";
28+ console.log("Checking comment body...");
29+ }
2330 const regexScreenshot = /@diff\s+(\S+)\s+(\S+)/; // Match URL + screenshot flag
2431 const regexArtifact = /@diff\s+(\S+)/; // Match only URL
2532
26- let match = commentBody .match(regexScreenshot);
33+ let match = body .match(regexScreenshot);
2734 if (match) {
2835 core.setOutput('triggered', 'true');
2936 core.setOutput('url', match[1].trim());
3037 core.setOutput('screenshot', match[2].trim());
3138 core.setOutput('mode', 'screenshot');
3239 } else {
33- match = commentBody .match(regexArtifact);
40+ match = body .match(regexArtifact);
3441 if (match) {
3542 core.setOutput('triggered', 'true');
3643 core.setOutput('url', match[1].trim());
You can’t perform that action at this time.
0 commit comments