Skip to content

Commit

Permalink
Merge pull request #8792 from ministryofjustice/feat/plan-summary-as-…
Browse files Browse the repository at this point in the history
…comment

adding check for no issue number
  • Loading branch information
markgov authored Jan 7, 2025
2 parents fb8d5c7 + 100ada1 commit 36929fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/reusable_terraform_plan_apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ jobs:
const workflowId = "${{ env.WORKSPACE_NAME }}";
const identifier = workflowId ? `_${workflowId}_\n` : `_${{ inputs.workflow_id }}_\n`;
const summary = `\`${{ steps.show.outputs.summary }}\``;
const issue_number = context.payload.pull_request.number;
const issue_number = context.payload.pull_request ? context.payload.pull_request.number : null;
if (!issue_number) {
console.log('No issue number found, skipping comment.');
return;
}
await github.rest.issues.createComment({
...context.repo,
issue_number,
Expand Down

0 comments on commit 36929fb

Please sign in to comment.