From b061530d14d7b2a83d464d32e2051ef5a5925a93 Mon Sep 17 00:00:00 2001 From: Darren Temple Date: Tue, 12 Nov 2024 17:16:15 +0000 Subject: [PATCH 1/4] Update deploy.yml Use the paths-filter custom action to check on changes to src/templates/, and if this has occurred then update NPM major version. --- .github/workflows/deploy.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 04f660a..81cf262 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,8 +23,14 @@ jobs: with: node-version: 14 registry-url: https://registry.npmjs.org/ + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + src: + - 'src/templates/**' - name: Increment Version (for security - and CSP asset alignment - every change to the template files is a breaking change) - # TODO: Make this conditional on if template files have actually changed + if: steps.filter.outputs.src == 'true' run: npm version major - name: Install and Build using incremented version run: npm ci From 79b65f0f8790f1107e980d962443f7e95e86607e Mon Sep 17 00:00:00 2001 From: Darren Temple Date: Tue, 12 Nov 2024 17:34:52 +0000 Subject: [PATCH 2/4] Update deploy.yml Clarified nomenclature to show the exact location of changes being observed by the paths-filter custom action. --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 81cf262..8ac0b5c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,10 +27,10 @@ jobs: id: filter with: filters: | - src: + src_templates: - 'src/templates/**' - name: Increment Version (for security - and CSP asset alignment - every change to the template files is a breaking change) - if: steps.filter.outputs.src == 'true' + if: steps.filter.outputs.src_templates == 'true' run: npm version major - name: Install and Build using incremented version run: npm ci From 562ffbb4f1e87d20b14aee2723d65af266007a46 Mon Sep 17 00:00:00 2001 From: Darren Temple Date: Wed, 13 Nov 2024 17:22:18 +0000 Subject: [PATCH 3/4] fix: Trigger new NPM major version on changes to static files as well as template files --- .github/workflows/deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8ac0b5c..063532e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,10 +27,12 @@ jobs: id: filter with: filters: | + src_static: + - 'src/static/**' src_templates: - 'src/templates/**' - name: Increment Version (for security - and CSP asset alignment - every change to the template files is a breaking change) - if: steps.filter.outputs.src_templates == 'true' + if: steps.filter.outputs.src_static == 'true' || steps.filter.outputs.src_templates == 'true' run: npm version major - name: Install and Build using incremented version run: npm ci From ac5a154ff8503868683477ac0851a7404f5e1f3a Mon Sep 17 00:00:00 2001 From: Darren Temple Date: Wed, 13 Nov 2024 17:32:44 +0000 Subject: [PATCH 4/4] fix: Update README.md to reflect CI trigger changes regarding NPM major version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6057781..d6ce9c2 100644 --- a/README.md +++ b/README.md @@ -215,4 +215,4 @@ All changes that impact the output dataset site templates or static assets MUST Minor and patch version numbers may be used to update any functionality of the npm library that impacts direct users of that library, but does not impact the templates or static assets themselves. -*NOTE*: All commits to master currently trigger a major version bump in CI by default. +*NOTE*: Only commits to master src/static/ and src/templates/ currently trigger a major version bump in CI by default.