File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 72
72
const url = "${{ steps.deploy.outputs.deployment-url }}";
73
73
const commentMarker = "🚀 Preview deployment available at:";
74
74
75
+ // Get commit SHA based on event type
76
+ let commitSha;
77
+ if ('${{ github.event_name }}' === 'pull_request') {
78
+ commitSha = '${{ github.event.pull_request.head.sha }}';
79
+ } else {
80
+ // For workflow_dispatch, get the SHA from the current commit
81
+ commitSha = '${{ github.sha }}';
82
+ }
83
+
75
84
// Get all comments on the PR
76
85
const comments = await github.rest.issues.listComments({
77
86
issue_number: prNumber,
85
94
comment.body.includes(commentMarker)
86
95
);
87
96
88
- const commentBody = `${commentMarker} [${url}](${url})`;
97
+ const commentBody = `${commentMarker} [${url}](${url}) (commit: ${commitSha}) `;
89
98
90
99
if (existingComment) {
91
100
// Update existing comment
You can’t perform that action at this time.
0 commit comments