Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/repo-guard.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: Repository Guard

on:
Expand Down Expand Up @@ -117,21 +117,29 @@
fi
} > body.md

# Render the same content on the run's Summary page - visible on
# fork PRs too, where the comment steps below are skipped.
cat body.md >> "$GITHUB_STEP_SUMMARY"

{
echo "body<<EOF"
cat body.md
echo "EOF"
} >> "$GITHUB_OUTPUT"

# Fork PRs get a read-only GITHUB_TOKEN, so the comment steps would 403.
# Skip them there - the "Fail if any check failed" step still gates.
- name: Find existing comment
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3
id: find
if: github.event.pull_request.head.repo.full_name == github.repository
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "<!-- repository-guard -->"

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