From 45d22629637664a83ad477ffa94c9c411f150bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Wed, 22 Dec 2021 20:57:26 +0200 Subject: [PATCH] Gate workflows to only run on upstream --- .github/workflows/ci.yaml | 3 +++ .github/workflows/metrics.yaml | 1 + .github/workflows/release.yaml | 4 ++-- .github/workflows/rustdoc.yaml | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 192ef11be37..baefd8bc1f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,7 @@ env: jobs: rust: + if: github.repository == 'rust-analyzer/rust-analyzer' name: Rust runs-on: ${{ matrix.os }} env: @@ -61,6 +62,7 @@ jobs: # Weird targets to catch non-portable code rust-cross: + if: github.repository == 'rust-analyzer/rust-analyzer' name: Rust Cross runs-on: ubuntu-latest @@ -97,6 +99,7 @@ jobs: done typescript: + if: github.repository == 'rust-analyzer/rust-analyzer' name: TypeScript strategy: fail-fast: false diff --git a/.github/workflows/metrics.yaml b/.github/workflows/metrics.yaml index d189ce9c901..f4412ef6570 100644 --- a/.github/workflows/metrics.yaml +++ b/.github/workflows/metrics.yaml @@ -12,6 +12,7 @@ env: jobs: metrics: + if: github.repository == 'rust-analyzer/rust-analyzer' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 563778ed683..4a1c70ebd39 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -247,12 +247,12 @@ jobs: working-directory: ./editors/code - name: Publish Extension (release) - if: github.ref == 'refs/heads/release' + if: github.ref == 'refs/heads/release' && github.repository == 'rust-analyzer/rust-analyzer' working-directory: ./editors/code # token from https://dev.azure.com/rust-analyzer/ run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix - name: Publish Extension (nightly) - if: github.ref != 'refs/heads/release' + if: github.ref != 'refs/heads/release' && github.repository == 'rust-analyzer/rust-analyzer' working-directory: ./editors/code run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release diff --git a/.github/workflows/rustdoc.yaml b/.github/workflows/rustdoc.yaml index 897f64df04b..ac69adb9477 100644 --- a/.github/workflows/rustdoc.yaml +++ b/.github/workflows/rustdoc.yaml @@ -12,6 +12,7 @@ env: jobs: rustdoc: + if: github.repository == 'rust-analyzer/rust-analyzer' runs-on: ubuntu-latest steps: