diff --git a/README.md b/README.md index 21b87fa..5c41384 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Installs the latest Angular CLI on Node 22 with npm caching. Zero config. | `node-version` | `22` | Node.js version — e.g. `22`, `20`, `18` | | `package-manager` | `npm` | `npm`, `yarn`, or `pnpm` | | `cache-dependency-path` | _(repo root)_ | Lock file path for monorepos | +| `cache` | `true` | Set to `false` to disable package manager caching | ## Outputs diff --git a/action.yml b/action.yml index 4ee530b..e3e0514 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,10 @@ inputs: description: 'Path to the lock file for caching (e.g. packages/app/package-lock.json). Defaults to repo root.' required: false default: '' + cache: + description: 'Enable package manager caching. Set to false to disable (e.g. if no lock file exists).' + required: false + default: 'true' outputs: cli-version: @@ -41,7 +45,7 @@ runs: uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} - cache: ${{ inputs.package-manager }} + cache: ${{ inputs.cache == 'true' && inputs.package-manager || '' }} cache-dependency-path: ${{ inputs.cache-dependency-path }} - name: Install Angular CLI (npm) diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ba781b1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "angular-setup", + "version": "2.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "angular-setup", + "version": "2.0.0", + "license": "MIT" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..a98bbc5 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "name": "angular-setup", + "version": "2.0.0", + "description": "GitHub Action: setup Node.js, cache npm/yarn/pnpm, and install Angular CLI", + "private": true, + "author": "Mayur Rawte ", + "license": "MIT" +}