Avoid creating resolved comments without an existing warning

Use a boolean --create-if-missing flag, supplied by the composite action by default and omitted for resolution updates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mario Campos
2026-10-29 11:32:57 -05:00
parent e9651489af
commit 94f0998581
4 changed files with 44 additions and 1 deletions

View File

@@ -9,6 +9,10 @@ inputs:
body:
description: "Full comment markdown."
required: true
create-if-missing:
description: "Create a comment if no matching marker exists. Set to 'false' to update existing comments only."
required: false
default: "true"
issue-id:
description: >
The issue or pull request number to post/update the comment on.
@@ -25,11 +29,13 @@ runs:
env:
BODY: ${{ inputs.body }}
MARKER: ${{ inputs.marker }}
CREATE_IF_MISSING: ${{ inputs.create-if-missing != 'false' && '--create-if-missing' || '' }}
GH_TOKEN: ${{ inputs.token }}
ISSUE_ID: ${{ inputs.issue-id || github.event.pull_request.number }}
run: |
npx tsx ./pr-checks/post-comment.ts \
--body "$BODY" \
--marker "$MARKER" \
$CREATE_IF_MISSING \
--issue-id "$ISSUE_ID" \
--repository "$GITHUB_REPOSITORY"

View File

@@ -313,6 +313,7 @@ jobs:
uses: ./.github/actions/post-comment
with:
marker: "post-comment:CHANGELOG.md"
create-if-missing: "false"
body: |
⚠️ `CHANGELOG.md` has been modified in this PR. Please do not modify `CHANGELOG.md` directly.
Instead, create a change-note file in `unreleased-change-notes/`. The `CHANGELOG.md`