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 7272 const url = "${{ steps.deploy.outputs.deployment-url }}";
7373 const commentMarker = "🚀 Preview deployment available at:";
7474
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+
7584 // Get all comments on the PR
7685 const comments = await github.rest.issues.listComments({
7786 issue_number: prNumber,
8594 comment.body.includes(commentMarker)
8695 );
8796
88- const commentBody = `${commentMarker} [${url}](${url})`;
97+ const commentBody = `${commentMarker} [${url}](${url}) (commit: ${commitSha}) `;
8998
9099 if (existingComment) {
91100 // Update existing comment
You can’t perform that action at this time.
0 commit comments