From 754c7484d56302d82dd0e0c82f05663a00d5193b Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 16 Feb 2022 14:33:23 -0700 Subject: [PATCH] fix: skip docs/npm workflows on forks --- .github/workflows/ci.yaml | 3 +++ .github/workflows/docs-preview.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d8af65da..8889b796 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -184,6 +184,9 @@ jobs: # This environment "npm" requires someone from # coder/code-server-reviewers to approve the PR before this job runs. environment: npm + # Only run if PR comes from base repo + # Reason: forks cannot access secrets and this will always fail + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/docs-preview.yaml b/.github/workflows/docs-preview.yaml index 21451e5f..b4b36baa 100644 --- a/.github/workflows/docs-preview.yaml +++ b/.github/workflows/docs-preview.yaml @@ -22,6 +22,9 @@ jobs: name: Docs preview runs-on: ubuntu-20.04 environment: CI + # Only run if PR comes from base repo + # Reason: forks cannot access secrets and this will always fail + if: github.event.pull_request.head.repo.full_name == github.repository steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.9.1