Skip to content

Commit ff5d662

Browse files
authored
Skip diffuse commenting on 3rd party PRs (#887)
The github token doesn't have write permissions when running on forks
1 parent a4ff695 commit ff5d662

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/android.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,22 @@ jobs:
237237
old-file-path: client-sdk-android/diffuse-source-file
238238
new-file-path: client-sdk-android/livekit-android-sdk-release.aar
239239

240+
- name: Log diffuse output
241+
run: |
242+
echo "Diffuse output:"
243+
echo "${{ steps.diffuse.outputs.diff-gh-comment }}"
244+
240245
# Consuming diffuse action output
241246

242247
- uses: peter-evans/find-comment@v4
248+
if: github.event.pull_request.head.repo.full_name == github.repository
243249
id: find_comment
244250
with:
245251
issue-number: ${{ github.event.pull_request.number }}
246252
body-includes: Diffuse output
247253

248254
- uses: peter-evans/create-or-update-comment@v5
249-
if: ${{ steps.diffuse.outputs.diff-raw != null || steps.find_comment.outputs.comment-id != null }}
255+
if: github.event.pull_request.head.repo.full_name == github.repository && (steps.diffuse.outputs.diff-raw != null || steps.find_comment.outputs.comment-id != null)
250256
with:
251257
body: |
252258
Diffuse output:

.github/workflows/dependency_diff.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ jobs:
2727
with:
2828
project: 'livekit-android-sdk'
2929

30+
- name: Log dependency diff
31+
run: |
32+
echo "Dependency diff:"
33+
echo "${{ steps.dependency-diff.outputs.text-diff }}"
34+
3035
- uses: peter-evans/find-comment@v4
36+
if: github.event.pull_request.head.repo.full_name == github.repository
3137
id: find_comment
3238
with:
3339
issue-number: ${{ github.event.pull_request.number }}
3440
body-includes: Dependency diff
3541

3642
- uses: peter-evans/create-or-update-comment@v5
37-
if: ${{ steps.dependency-diff.outputs.text-diff != null || steps.find_comment.outputs.comment-id != null }}
43+
if: github.event.pull_request.head.repo.full_name == github.repository && (steps.dependency-diff.outputs.text-diff != null || steps.find_comment.outputs.comment-id != null)
3844
with:
3945
body: |
4046
Dependency diff:

0 commit comments

Comments
 (0)