From 338cf37a18f7176e0ee27c0a6ca66be09695521a Mon Sep 17 00:00:00 2001 From: Kevin Hoerr Date: Wed, 28 Dec 2022 12:23:56 -0500 Subject: Skip version update if source files unchanged (#53) * Skip version update if source files unchanged * fix path --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62e11ed..c3137f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,15 +22,25 @@ jobs: cache: 'npm' - name: Install Node.js packages run: npm ci + - name: Get current date id: date run: echo "::set-output name=date::$(date +'%s')" + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + source: + - 'src/**' + # modify version number if actual source files changed - name: Modify version number uses: mingjun97/file-regex-replace@v1 + if: steps.filter.outputs.source == "true" with: regex: 'version: "[0-9]*",' replacement: 'version: "${{ steps.date.outputs.date }}",' include: 'gatsby-config\.ts' + - name: Clean Gatsby cache run: npm run clean - name: Run Gatsby Build -- cgit