Skip to content

Commit 251d680

Browse files
committed
build: ensure only one PR commit message comment gets created
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent c088660 commit 251d680

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/generate_pr_commit_message.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,23 @@ jobs:
8282
# Ensure the script itself doesn't fail the workflow:
8383
exit 0
8484
85+
# Check if the commit message already exists in the PR comments:
86+
- name: 'Check if commit message already exists in PR comments'
87+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
88+
id: fc
89+
with:
90+
issue-number: ${{ github.event.pull_request.number }}
91+
body-includes: '<!-- PR_COMMIT_MESSAGE -->'
92+
8593
# Post commit message as PR comment:
8694
- name: 'Post commit message as PR comment'
8795
# Pin action to full length commit SHA
8896
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
8997
with:
9098
token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
99+
comment-id: ${{ steps.fc.outputs.comment-id }}
91100
issue-number: ${{ github.event.pull_request.number }}
101+
edit-mode: replace
92102
body: |
93103
### PR Commit Message
94104

0 commit comments

Comments
 (0)