From 49f2412ea0a49f001f043505bc118255e10254a3 Mon Sep 17 00:00:00 2001 From: davidliu Date: Tue, 17 Mar 2026 19:43:29 +0900 Subject: [PATCH] Skip diffuse commenting on 3rd party PRs The github token doesn't have write permissions when running on forks --- .github/workflows/android.yml | 8 +++++++- .github/workflows/dependency_diff.yml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index e4345a2d7..efa56caa9 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -237,16 +237,22 @@ jobs: old-file-path: client-sdk-android/diffuse-source-file new-file-path: client-sdk-android/livekit-android-sdk-release.aar + - name: Log diffuse output + run: | + echo "Diffuse output:" + echo "${{ steps.diffuse.outputs.diff-gh-comment }}" + # Consuming diffuse action output - uses: peter-evans/find-comment@v4 + if: github.event.pull_request.head.repo.full_name == github.repository id: find_comment with: issue-number: ${{ github.event.pull_request.number }} body-includes: Diffuse output - uses: peter-evans/create-or-update-comment@v5 - if: ${{ steps.diffuse.outputs.diff-raw != null || steps.find_comment.outputs.comment-id != null }} + if: github.event.pull_request.head.repo.full_name == github.repository && (steps.diffuse.outputs.diff-raw != null || steps.find_comment.outputs.comment-id != null) with: body: | Diffuse output: diff --git a/.github/workflows/dependency_diff.yml b/.github/workflows/dependency_diff.yml index aa034a71d..0ef1cc9ac 100644 --- a/.github/workflows/dependency_diff.yml +++ b/.github/workflows/dependency_diff.yml @@ -27,14 +27,20 @@ jobs: with: project: 'livekit-android-sdk' + - name: Log dependency diff + run: | + echo "Dependency diff:" + echo "${{ steps.dependency-diff.outputs.text-diff }}" + - uses: peter-evans/find-comment@v4 + if: github.event.pull_request.head.repo.full_name == github.repository id: find_comment with: issue-number: ${{ github.event.pull_request.number }} body-includes: Dependency diff - uses: peter-evans/create-or-update-comment@v5 - if: ${{ steps.dependency-diff.outputs.text-diff != null || steps.find_comment.outputs.comment-id != null }} + 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) with: body: | Dependency diff: