From 170062d5bc7d4638a3e6af8a564cd881d798f1f0 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Fri, 4 Aug 2023 10:57:43 -0700 Subject: [PATCH] ci: only render gocd pipelines if relevant files are changed (#1276) --- .github/workflows/validate-pipelines.yml | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/validate-pipelines.yml b/.github/workflows/validate-pipelines.yml index d08171991..d40a6e9d2 100644 --- a/.github/workflows/validate-pipelines.yml +++ b/.github/workflows/validate-pipelines.yml @@ -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 @@ -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