diff --git a/action.yml b/action.yml index 7f7b51d..d462916 100644 --- a/action.yml +++ b/action.yml @@ -10,13 +10,19 @@ inputs: runs: using: composite steps: + # We need to copy codemention's package-lock.json into the workspace + # because hashFiles only works on files inside the workspace. + - run: cp ${{ github.action_path }}/package-lock.json codemention-package-lock.json + shell: bash - uses: actions/cache@v3 + id: cache-node-modules with: path: ${{ github.action_path }}/node_modules - key: codemention-npm + key: codemention-npm-${{ hashFiles('codemention-package-lock.json') }} - run: npm install working-directory: ${{ github.action_path }} shell: bash + if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm run build working-directory: ${{ github.action_path }} shell: bash