Skip to content

Commit

Permalink
ci: only render gocd pipelines if relevant files are changed (#2376)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuarli authored Aug 3, 2023
1 parent b5ce7a4 commit 92b6700
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/validate-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ on:
pull_request:

jobs:
render:
name: Render GoCD Pipelines with Jsonnet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- uses: getsentry/action-gocd-jsonnet@v1
with:
jb-install: true
check-for-changes: true
convert-to-yaml: true
jsonnet-dir: gocd/templates
generated-dir: gocd/generated-pipelines
render-as-single-file: false

files-changed:
name: files-changed
runs-on: ubuntu-latest
Expand All @@ -40,6 +26,22 @@ jobs:
- 'gocd/**'
- '.github/workflows/validate-pipelines.yml'
render:
if: needs.files-changed.outputs.gocd == 'true'
needs: files-changed
name: Render GoCD Pipelines with Jsonnet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- uses: getsentry/action-gocd-jsonnet@v1
with:
jb-install: true
check-for-changes: true
convert-to-yaml: true
jsonnet-dir: gocd/templates
generated-dir: gocd/generated-pipelines
render-as-single-file: false

validate:
if: needs.files-changed.outputs.gocd == 'true'
needs: files-changed
Expand Down

0 comments on commit 92b6700

Please sign in to comment.