From 0079884297f7418948a4ab36f51cca605538cc35 Mon Sep 17 00:00:00 2001 From: Marcello Date: Mon, 12 Aug 2024 21:50:20 +0000 Subject: [PATCH] Prevent trying to create PR comments in the CI when it doesn't have permission --- .github/workflows/selfdrive_tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 3eac9c63d9fc75..2258b2c911a32d 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -301,7 +301,7 @@ jobs: issue-number: ${{ github.event.pull_request.number }} body-includes: This PR makes changes to - name: Update comment - if: ${{ steps.save_diff.outputs.diff != '' }} + if: ${{ steps.save_diff.outputs.diff != '' && env.AZURE_TOKEN != '' }} uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: comment-id: ${{ steps.fc.outputs.comment-id }} @@ -309,7 +309,7 @@ jobs: body: "${{ steps.save_diff.outputs.diff }}" edit-mode: replace - name: Delete comment - if: ${{ steps.fc.outputs.comment-id != '' && steps.save_diff.outputs.diff == '' }} + if: ${{ steps.fc.outputs.comment-id != '' && steps.save_diff.outputs.diff == '' && env.AZURE_TOKEN != '' }} uses: actions/github-script@v7 with: script: |