Skip to content

Commit 06c428b

Browse files
authored
fix: only post comment when checking PRs (#279)
Changes the comment posting so it only happens on checking PRs, not on checking merge. Additionally, adds a continue on error, so that if there are future errors, they aren't blocking.
1 parent 12243ab commit 06c428b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

action.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,11 @@ runs:
267267
268268
- name: Find Comment
269269
uses: peter-evans/find-comment@v3
270-
if: inputs.check-mode == 'payload' && env.INPUT_GITHUB_TOKEN
270+
if: |
271+
inputs.check-mode == 'payload' && env.TRUNK_CHECK_MODE == 'pull_request' &&
272+
env.INPUT_GITHUB_TOKEN
271273
id: fc
274+
continue-on-error: true
272275
with:
273276
issue-number: ${{ env.GITHUB_EVENT_PULL_REQUEST_NUMBER }}
274277
repository: ${{ env.INPUT_TARGET_CHECKOUT }}
@@ -277,7 +280,10 @@ runs:
277280

278281
- name: Post comment
279282
uses: peter-evans/create-or-update-comment@v4
280-
if: inputs.check-mode == 'payload' && env.INPUT_GITHUB_TOKEN
283+
if: |
284+
inputs.check-mode == 'payload' && env.TRUNK_CHECK_MODE == 'pull_request' &&
285+
env.INPUT_GITHUB_TOKEN
286+
continue-on-error: true
281287
with:
282288
comment-id: ${{ steps.fc.outputs.comment-id }}
283289
issue-number: ${{ env.GITHUB_EVENT_PULL_REQUEST_NUMBER }}

0 commit comments

Comments
 (0)