Skip to content

Commit

Permalink
fix: don't post PR comments on forks
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Jan 9, 2023
1 parent bc6455e commit 7a4e90f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -791,11 +791,14 @@ jobs:
id: process
run: yarn ci:process
working-directory: packages/replay/metrics
# Don't run on forks - the PR comment cannot be added.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload results
uses: actions/upload-artifact@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
with:
name: ${{ steps.process.outputs.artifactName }}
path: ${{ steps.process.outputs.artifactPath }}
2 changes: 1 addition & 1 deletion packages/replay/metrics/src/util/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function tryAddOrUpdateComment(commentBuilder: PrCommentBuilder): Promise<
body: commentBuilder.body,
});
} else {
console.log(`Adding new PR comment to PR ${prNumber}`)
console.log(`Adding a new comment to PR ${prNumber}`)
await octokit.rest.issues.createComment({
...defaultArgs,
issue_number: prNumber,
Expand Down

0 comments on commit 7a4e90f

Please sign in to comment.