mirror of
https://github.com/github/codeql-action.git
synced 2026-11-10 14:56:01 +00:00
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:
6
.github/actions/post-comment/action.yml
vendored
6
.github/actions/post-comment/action.yml
vendored
@@ -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"
|
||||
|
||||
1
.github/workflows/pr-checks.yml
vendored
1
.github/workflows/pr-checks.yml
vendored
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user