Skip to content

Commit af04359

Browse files
committed
fix: don't post PR comments on forks
1 parent bc6455e commit af04359

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,8 @@ jobs:
791791
id: process
792792
run: yarn ci:process
793793
working-directory: packages/replay/metrics
794+
# Don't run on forks - the PR comment cannot be added.
795+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
794796
env:
795797
GITHUB_TOKEN: ${{ github.token }}
796798

packages/replay/metrics/src/util/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async function tryAddOrUpdateComment(commentBuilder: PrCommentBuilder): Promise<
9898
body: commentBuilder.body,
9999
});
100100
} else {
101-
console.log(`Adding new PR comment to PR ${prNumber}`)
101+
console.log(`Adding a new comment to PR ${prNumber}`)
102102
await octokit.rest.issues.createComment({
103103
...defaultArgs,
104104
issue_number: prNumber,

0 commit comments

Comments
 (0)