From f86d30f4a139de6a1d332a008cd9ac9b1eb61454 Mon Sep 17 00:00:00 2001 From: Steve Riesenberg Date: Wed, 27 Jul 2022 15:34:43 -0500 Subject: [PATCH] Only run prerequisites job if on upstream repo --- .github/workflows/continuous-integration-workflow.yml | 3 +-- .github/workflows/pr-build-workflow.yml | 8 ++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 1cde8bcb08..71ae774b5b 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -18,7 +18,6 @@ env: STRUCTURE101_LICENSEID: ${{ secrets.STRUCTURE101_LICENSEID }} ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - RUN_JOBS: ${{ github.repository == 'spring-projects/spring-security' }} permissions: contents: read @@ -27,6 +26,7 @@ jobs: prerequisites: name: Pre-requisites for building runs-on: ubuntu-latest + if: ${{ github.repository == 'spring-projects/spring-security' }} outputs: runjobs: ${{ steps.continue.outputs.runjobs }} project_version: ${{ steps.continue.outputs.project_version }} @@ -34,7 +34,6 @@ jobs: - uses: actions/checkout@v2 - id: continue name: Determine if should continue - if: env.RUN_JOBS == 'true' run: | # Run jobs if in upstream repository echo "::set-output name=runjobs::true" diff --git a/.github/workflows/pr-build-workflow.yml b/.github/workflows/pr-build-workflow.yml index ea0bb412ec..cf332e8b45 100644 --- a/.github/workflows/pr-build-workflow.yml +++ b/.github/workflows/pr-build-workflow.yml @@ -2,9 +2,6 @@ name: PR Build on: pull_request -env: - RUN_JOBS: ${{ github.repository == 'spring-projects/spring-security' }} - permissions: contents: read @@ -12,14 +9,13 @@ jobs: build: name: Build runs-on: ubuntu-latest + if: ${{ github.repository == 'spring-projects/spring-security' }} steps: - - if: env.RUN_JOBS == 'true' - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - name: Set up gradle uses: spring-io/spring-gradle-build-action@v1 with: java-version: '17' distribution: 'temurin' - name: Build with Gradle - if: env.RUN_JOBS == 'true' run: ./gradlew clean build --continue --scan