Skip to content

Commit

Permalink
ci: only render gocd pipelines if relevant files are changed (#1276)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuarli authored Aug 4, 2023
1 parent 8cc1e63 commit 170062d
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 @@ -10,20 +10,6 @@ concurrency:
cancel-in-progress: true

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 @@ -41,6 +27,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 170062d

Please sign in to comment.