From c5d8eb9b264eedf78d8a9e51469b9ed4f6d65e0b Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Fri, 26 Sep 2025 09:34:39 +0100 Subject: [PATCH] feat: cache main branch --- .github/workflows/diff-dependencies.yml | 13 +++++++++++++ README.md | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/diff-dependencies.yml b/.github/workflows/diff-dependencies.yml index ef7f6d6..d9e5a6a 100644 --- a/.github/workflows/diff-dependencies.yml +++ b/.github/workflows/diff-dependencies.yml @@ -11,15 +11,28 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: ref: main + - name: Get main commit SHA + id: main-sha + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + - name: Check cache for main build + id: cache-main + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: '*.tgz' + key: main-build-${{ steps.main-sha.outputs.sha }} - name: Use Node + if: steps.cache-main.outputs.cache-hit != 'true' uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: node-version: 24.x - name: Install Dependencies + if: steps.cache-main.outputs.cache-hit != 'true' run: npm ci --ignore-scripts - name: Build + if: steps.cache-main.outputs.cache-hit != 'true' run: npm run build - name: Pack + if: steps.cache-main.outputs.cache-hit != 'true' run: npm pack - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: diff --git a/README.md b/README.md index 26535bd..fc6d3f2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# @e18e/action-dependency-diff +# e18e/action-dependency-diff > A GitHub action for reporting differences in dependencies between two branches or commits.