Skip to content

Commit

Permalink
Disable bot HTML artifacts comment if PR from fork (ros2#4573)
Browse files Browse the repository at this point in the history
Since the current repository workflow configuration does not give write
permissions (for creating/modifying a comment) to workflows for PRs
from a fork.

Signed-off-by: Christophe Bedard <[email protected]>
  • Loading branch information
christophebedard authored Jul 21, 2024
1 parent b88e8ef commit b4ebdbc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,17 @@ jobs:
- name: Find HTML artifacts link comment
uses: peter-evans/find-comment@v3
id: find-comment
# Skip if PR from fork
if: github.repository == github.event.pull_request.head.repo.full_name
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: "HTML artifacts:"

- name: Create or update HTML artifacts link comment
uses: peter-evans/create-or-update-comment@v4
# Skip if PR from fork
if: github.repository == github.event.pull_request.head.repo.full_name
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
Expand Down

0 comments on commit b4ebdbc

Please sign in to comment.