Only run prerequisites job if on upstream repo

This commit is contained in:
Steve Riesenberg 2022-07-27 15:34:43 -05:00
parent 13e94935ae
commit aad60cc6af
No known key found for this signature in database
GPG Key ID: 5F311AB48A55D521
2 changed files with 3 additions and 8 deletions

View File

@ -18,7 +18,6 @@ env:
STRUCTURE101_LICENSEID: ${{ secrets.STRUCTURE101_LICENSEID }} STRUCTURE101_LICENSEID: ${{ secrets.STRUCTURE101_LICENSEID }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
RUN_JOBS: ${{ github.repository == 'spring-projects/spring-security' }}
permissions: permissions:
contents: read contents: read
@ -27,6 +26,7 @@ jobs:
prerequisites: prerequisites:
name: Pre-requisites for building name: Pre-requisites for building
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.repository == 'spring-projects/spring-security' }}
outputs: outputs:
runjobs: ${{ steps.continue.outputs.runjobs }} runjobs: ${{ steps.continue.outputs.runjobs }}
project_version: ${{ steps.continue.outputs.project_version }} project_version: ${{ steps.continue.outputs.project_version }}
@ -34,7 +34,6 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- id: continue - id: continue
name: Determine if should continue name: Determine if should continue
if: env.RUN_JOBS == 'true'
run: | run: |
# Run jobs if in upstream repository # Run jobs if in upstream repository
echo "::set-output name=runjobs::true" echo "::set-output name=runjobs::true"

View File

@ -2,9 +2,6 @@ name: PR Build
on: pull_request on: pull_request
env:
RUN_JOBS: ${{ github.repository == 'spring-projects/spring-security' }}
permissions: permissions:
contents: read contents: read
@ -12,14 +9,13 @@ jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.repository == 'spring-projects/spring-security' }}
steps: steps:
- if: env.RUN_JOBS == 'true' - uses: actions/checkout@v2
uses: actions/checkout@v2
- name: Set up gradle - name: Set up gradle
uses: spring-io/spring-gradle-build-action@v1 uses: spring-io/spring-gradle-build-action@v1
with: with:
java-version: '11' java-version: '11'
distribution: 'adopt' distribution: 'adopt'
- name: Build with Gradle - name: Build with Gradle
if: env.RUN_JOBS == 'true'
run: ./gradlew clean build --continue --scan run: ./gradlew clean build --continue --scan