From c5fe1e8810930b73484d26029eb8c378aadc9f26 Mon Sep 17 00:00:00 2001 From: Tom - Henry Coursow Date: Thu, 27 Jul 2023 19:19:48 +0200 Subject: [PATCH] action.yml aktualisiert --- action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 55b2093..b1768bc 100644 --- a/action.yml +++ b/action.yml @@ -10,12 +10,18 @@ name: 'Get & Cache Dependencies' description: 'Get the Dependencies from the cache for a (npm) Node JS Project or initialize the cache for it' +# Inputs can be given with the 'with:' key later when using the custom action inputs: caching: description: 'If the cache should be used or not' required: false default: 'true' +outputs: + cache-hit: + description: 'Provides information if the cache was used during the action execution (true) or not (false)' + value: ${{ steps.install.outputs.cache-hit }} + runs: using: 'composite' # Must be 'composite' for a custom composite action steps: @@ -37,6 +43,9 @@ runs: path: node_modules key: deps-node-modules-${{ steps.get-cache-hash.outputs.hash }} - name: Install dependencies + id: install if: steps.cache.outputs.cache-hit != 'true' || inputs.caching != 'true' - run: npm ci + run: | + npm ci + echo "cache-hit='true'" >> $GITHUB_OUTPUT shell: bash # compared to workflow ymls... Action ymls require the 'shell' property when a 'run' property was used! \ No newline at end of file