diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..15611cf --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,158 @@ +name: Test Action + +on: + push: + branches: [master, main, 'feat/**'] + pull_request: + branches: [master, main] + +jobs: + # ── npm ────────────────────────────────────────────────────────────────── + test-npm: + name: Test — npm (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + + - name: Run action with npm (default) + id: setup + uses: ./ + with: + version: 'latest' + node-version: '22' + package-manager: 'npm' + + - name: Verify CLI version output is set + shell: bash + run: | + echo "CLI version: ${{ steps.setup.outputs.cli-version }}" + if [ "${{ steps.setup.outputs.cli-version }}" = "unknown" ]; then + echo "ERROR: cli-version output was 'unknown'" + exit 1 + fi + + - name: Verify ng is on PATH + shell: bash + run: ng version + + # ── pnpm ───────────────────────────────────────────────────────────────── + test-pnpm: + name: Test — pnpm (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + + - name: Run action with pnpm + id: setup + uses: ./ + with: + version: 'latest' + node-version: '22' + package-manager: 'pnpm' + + - name: Verify CLI version output is set + shell: bash + run: | + echo "CLI version: ${{ steps.setup.outputs.cli-version }}" + if [ "${{ steps.setup.outputs.cli-version }}" = "unknown" ]; then + echo "ERROR: cli-version output was 'unknown'" + exit 1 + fi + + - name: Verify ng is on PATH + shell: bash + run: ng version + + # ── yarn ───────────────────────────────────────────────────────────────── + test-yarn: + name: Test — yarn (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + + - name: Run action with yarn + id: setup + uses: ./ + with: + version: 'latest' + node-version: '22' + package-manager: 'yarn' + + - name: Verify CLI version output is set + shell: bash + run: | + echo "CLI version: ${{ steps.setup.outputs.cli-version }}" + if [ "${{ steps.setup.outputs.cli-version }}" = "unknown" ]; then + echo "ERROR: cli-version output was 'unknown'" + exit 1 + fi + + - name: Verify ng is on PATH + shell: bash + run: ng version + + # ── pinned version ──────────────────────────────────────────────────────── + test-pinned-version: + name: Test — pinned Angular CLI version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run action with pinned Angular CLI version + id: setup + uses: ./ + with: + version: '17.3.8' + node-version: '20' + package-manager: 'npm' + + - name: Verify the correct version was installed + shell: bash + run: | + INSTALLED="${{ steps.setup.outputs.cli-version }}" + echo "Installed: $INSTALLED" + if [ "$INSTALLED" != "17.3.8" ]; then + echo "ERROR: expected 17.3.8, got $INSTALLED" + exit 1 + fi + + # ── Node version matrix ─────────────────────────────────────────────────── + test-node-versions: + name: Test — Node ${{ matrix.node }} + runs-on: ubuntu-latest + strategy: + matrix: + node: ['18', '20', '22'] + steps: + - uses: actions/checkout@v4 + + - name: Run action with Node ${{ matrix.node }} + id: setup + uses: ./ + with: + version: 'latest' + node-version: ${{ matrix.node }} + package-manager: 'npm' + + - name: Verify node version + shell: bash + run: | + NODE_VER=$(node --version) + echo "Node version: $NODE_VER" + if [[ "$NODE_VER" != v${{ matrix.node }}* ]]; then + echo "ERROR: expected Node ${{ matrix.node }}, got $NODE_VER" + exit 1 + fi + + - name: Verify ng is on PATH + shell: bash + run: ng version diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..95ffb61 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,50 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [2.0.0] — 2026-05-21 + +### Added +- `node-version` input — choose Node.js 18, 20, 22, or any version (default: `22`) +- `package-manager` input — supports `npm`, `yarn`, and `pnpm` (default: `npm`) +- `cache-dependency-path` input — monorepo support, point to any lock file +- Integration test workflow covering npm, pnpm, yarn, and pinned CLI version +- Windows and macOS runner coverage in CI + +### Changed +- Converted from Node.js action to composite action — no compilation step, no `dist/` directory +- Upgraded Node.js runtime from 20 → 22 +- Action name updated to `Angular Setup` for better marketplace discoverability +- Completely rewritten README with copy-paste examples for all package managers + +### Removed +- TypeScript source (`src/action.ts`) +- Compiled dist (`dist/action.js`) +- `package.json`, `package-lock.json`, `tsconfig.json` — no longer needed + +### Migration from v1 +All existing `v1` workflows continue to work unchanged — new inputs are optional with backwards-compatible defaults. + +```yml +# v1 (still works) +- uses: mayurrawte/github-angular-actions@v1 + with: + version: '17.3.8' + +# v2 (recommended) +- uses: mayurrawte/github-angular-actions@v2 + with: + version: '17.3.8' + node-version: '22' + package-manager: 'npm' +``` + +## [1.1.0] — 2022-10-01 + +### Changed +- Migrated codebase to TypeScript + +## [1.0.0] — 2021 + +### Added +- Initial release: install Angular CLI at a specific version with npm cache diff --git a/README.md b/README.md index cccc1a4..21b87fa 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,150 @@ - -# Github Angular Actions +# Angular Setup — GitHub Action [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/) +![Test Action](https://github.com/mayurrawte/github-angular-actions/actions/workflows/test.yml/badge.svg) +[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Angular%20Setup-blue?logo=github)](https://github.com/marketplace/actions/angular-github-actions) +![Platforms](https://img.shields.io/badge/runs%20on-ubuntu%20%7C%20windows%20%7C%20macos-lightgrey) + +> **One step.** Set up Node.js, cache your package manager, and install Angular CLI. +> Works with **npm**, **yarn**, and **pnpm** — no boilerplate required. + +--- + +## Quick start + +```yml +- uses: mayurrawte/github-angular-actions@v2 +``` + +Installs the latest Angular CLI on Node 22 with npm caching. Zero config. + +--- + +## Inputs -GitHub Action to install Angular CLI with optional version selection. -The action now caches the npm cache to speed up subsequent runs. +| Input | Default | Description | +|-------|---------|-------------| +| `version` | `latest` | Angular CLI version — e.g. `17.3.8`, `18.0.0`, or `latest` | +| `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 | +## Outputs + +| Output | Description | +|--------|-------------| +| `cli-version` | Installed Angular CLI version, e.g. `17.3.8` | +--- -## Usage +## Examples +### Default — latest Angular, Node 22, npm ```yml -- name: Install Latest Angular - uses: actions/angular-github-actions +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + - run: npm ci + - run: npm run build ``` -You can also specify the version +### Pin Angular CLI and Node versions ```yml -- name: Install Angular 12.2.7 - uses: actions/angular-github-actions - with: - version: 12.2.7 +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + version: '17.3.8' + node-version: '20' + - run: npm ci + - run: npm test -- --watch=false --browsers=ChromeHeadless ``` -## Outputs -- `cli-version` – the installed Angular CLI version +### Angular 16+ with Jest + +Angular 16 and above supports Jest as the test runner. No extra setup needed — just run your test command after the action: + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + version: 'latest' + node-version: '22' + - run: npm ci + - run: npm test # runs Jest if configured via ng generate jest +``` + +### pnpm + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + node-version: '22' + package-manager: 'pnpm' + - run: pnpm install + - run: pnpm build +``` + +### yarn + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + node-version: '22' + package-manager: 'yarn' + - run: yarn install --frozen-lockfile + - run: yarn build +``` + +### Monorepo — lock file in a subdirectory + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + package-manager: 'npm' + cache-dependency-path: 'packages/app/package-lock.json' + - run: npm ci --workspace=packages/app +``` + +### Use the `cli-version` output downstream + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + id: ng-setup + - run: echo "Running on Angular CLI ${{ steps.ng-setup.outputs.cli-version }}" +``` + +--- + +## Why this action? + +| Feature | This action | `actions/setup-node` only | +|---------|:-----------:|:-------------------------:| +| Installs Angular CLI globally | ✅ | ❌ | +| Specific CLI version | ✅ | ❌ | +| Node.js version selection | ✅ | ✅ | +| npm caching | ✅ | ✅ | +| **pnpm caching** | ✅ | ✅ (manual config) | +| **yarn caching** | ✅ | ✅ (manual config) | +| Monorepo lock file path | ✅ | ✅ (manual config) | +| Exposes `cli-version` output | ✅ | ❌ | +| Zero config | ✅ | ❌ (need extra step) | + +Use this action when `@angular/cli` is **not** in your `devDependencies` — common in legacy projects, shared runner setups, or anywhere you run `ng` directly in CI scripts. + +--- + +## License -Caching for the npm directory is enabled by default to optimize your workflow. +MIT diff --git a/action.yml b/action.yml index bd62dee..4ee530b 100644 --- a/action.yml +++ b/action.yml @@ -1,21 +1,69 @@ -# action.yml -name: 'Angular Github Actions' -description: 'Install Angular CLI and cache npm dependencies' +name: 'Angular Setup' +description: 'One-step Angular CI setup: installs Angular CLI, configures Node.js, and caches npm, yarn, or pnpm.' author: 'Mayur Rawte' branding: - icon: 'layers' + icon: 'zap' color: 'red' + inputs: version: - description: 'Angular CLI version to install' + description: 'Angular CLI version to install (e.g. 17.3.8, 18.0.0, or latest)' required: false default: 'latest' + node-version: + description: 'Node.js version to use (e.g. 22, 20, 18)' + required: false + default: '22' + package-manager: + description: 'Package manager to cache and use for the global CLI install: npm, yarn, or pnpm' + required: false + default: 'npm' + cache-dependency-path: + description: 'Path to the lock file for caching (e.g. packages/app/package-lock.json). Defaults to repo root.' + required: false + default: '' + outputs: cli-version: - description: 'Installed Angular CLI version' - installation-output: - description: 'Output from npm install' + description: 'The installed Angular CLI version string (e.g. 17.3.8)' + value: ${{ steps.get-version.outputs.cli-version }} + runs: - using: 'node20' - main: 'dist/action.js' + using: composite + steps: + - name: Setup pnpm + if: ${{ inputs.package-manager == 'pnpm' }} + uses: pnpm/action-setup@v4 + with: + version: latest + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + cache: ${{ inputs.package-manager }} + cache-dependency-path: ${{ inputs.cache-dependency-path }} + + - name: Install Angular CLI (npm) + if: ${{ inputs.package-manager == 'npm' || inputs.package-manager == '' }} + shell: bash + run: npm install -g @angular/cli@${{ inputs.version }} + + - name: Install Angular CLI (pnpm) + if: ${{ inputs.package-manager == 'pnpm' }} + shell: bash + run: pnpm add -g @angular/cli@${{ inputs.version }} + + - name: Install Angular CLI (yarn) + if: ${{ inputs.package-manager == 'yarn' }} + shell: bash + run: | + yarn global add @angular/cli@${{ inputs.version }} + echo "$(yarn global bin)" >> "$GITHUB_PATH" + - name: Get Angular CLI version + id: get-version + shell: bash + run: | + CLI_VERSION=$(ng version 2>/dev/null | grep -i 'Angular CLI:' | awk '{print $NF}' || echo "unknown") + echo "cli-version=$CLI_VERSION" >> "$GITHUB_OUTPUT" diff --git a/dist/action.js b/dist/action.js deleted file mode 100644 index f4b0c9f..0000000 --- a/dist/action.js +++ /dev/null @@ -1,32 +0,0 @@ -import * as core from '@actions/core'; -import * as cache from '@actions/cache'; -import { execSync } from 'child_process'; -async function run() { - let version = core.getInput('version') || 'latest'; - core.info(`Installing Angular CLI @${version}`); - const npmCachePath = execSync('npm config get cache').toString().trim(); - try { - await cache.restoreCache([npmCachePath], `npm-cache-${process.platform}-${process.arch}`); - } - catch (e) { - core.debug(`Cache restore failed: ${e}`); - } - const installOutput = execSync(`npm install -g @angular/cli@${version}`).toString(); - core.setOutput('installation-output', installOutput); - let cliVersion = 'unknown'; - try { - const json = execSync('npx ng version --json').toString(); - cliVersion = JSON.parse(json).cli.version; - } - catch (e) { - core.warning(`Could not determine Angular CLI version: ${e}`); - } - core.setOutput('cli-version', cliVersion); - try { - await cache.saveCache([npmCachePath], `npm-cache-${process.platform}-${process.arch}`); - } - catch (e) { - core.debug(`Cache save failed: ${e}`); - } -} -run().catch(err => core.setFailed(err.message)); diff --git a/docs/superpowers/plans/2026-05-21-v2-composite-action.md b/docs/superpowers/plans/2026-05-21-v2-composite-action.md new file mode 100644 index 0000000..4f8773a --- /dev/null +++ b/docs/superpowers/plans/2026-05-21-v2-composite-action.md @@ -0,0 +1,530 @@ +# Angular Github Actions v2.0 Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Convert the Node.js action into a composite action that supports `node-version`, `package-manager` (npm/yarn/pnpm), and Angular CLI version selection — filling the gap no competitor covers. + +**Architecture:** Replace the TypeScript/dist approach with a pure-YAML composite action that shells out to `actions/setup-node@v4` and `pnpm/action-setup@v4` as sub-steps. No compilation step. No dist directory. Shell scripts handle CLI install and version detection. + +**Tech Stack:** YAML composite action, Bash shell steps, `actions/setup-node@v4`, `pnpm/action-setup@v4` + +--- + +## File Map + +| Status | File | Purpose | +|--------|------|---------| +| **Rewrite** | `action.yml` | Composite action definition with new inputs | +| **Create** | `.github/workflows/test.yml` | Integration test — runs action with npm, yarn, pnpm | +| **Update** | `README.md` | Document all new inputs with copy-paste examples | +| **Delete** | `src/action.ts` | Obsolete — logic moves to shell steps in action.yml | +| **Delete** | `dist/action.js` | Obsolete — no longer a Node action | +| **Delete** | `package.json` | Obsolete — no npm dependencies | +| **Delete** | `package-lock.json` | Obsolete | +| **Delete** | `tsconfig.json` | Obsolete | + +--- + +## Task 1: Create a feature branch + +**Files:** (git only) + +- [ ] **Step 1: Create and switch to v2 branch** + +```bash +cd /Users/mayurrawte/github-angular-actions +git checkout -b feat/v2-composite-action +``` + +Expected: `Switched to a new branch 'feat/v2-composite-action'` + +--- + +## Task 2: Rewrite action.yml as composite action + +**Files:** +- Rewrite: `action.yml` + +- [ ] **Step 1: Overwrite action.yml with the composite definition** + +Replace the entire file with: + +```yaml +name: 'Angular Github Actions' +description: 'Setup Node.js, package manager caching, and Angular CLI — npm, yarn, and pnpm supported' +author: 'Mayur Rawte' +branding: + icon: 'layers' + color: 'red' + +inputs: + version: + description: 'Angular CLI version to install (e.g. 17.3.8, 18.0.0, or latest)' + required: false + default: 'latest' + node-version: + description: 'Node.js version to use (e.g. 22, 20, 18)' + required: false + default: '22' + package-manager: + description: 'Package manager to cache and use for the global CLI install: npm, yarn, or pnpm' + required: false + default: 'npm' + cache-dependency-path: + description: 'Path to the lock file for caching (e.g. packages/app/package-lock.json). Defaults to repo root.' + required: false + default: '' + +outputs: + cli-version: + description: 'The installed Angular CLI version string (e.g. 17.3.8)' + value: ${{ steps.get-version.outputs.cli-version }} + +runs: + using: composite + steps: + - name: Setup pnpm + if: ${{ inputs.package-manager == 'pnpm' }} + uses: pnpm/action-setup@v4 + with: + version: latest + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + cache: ${{ inputs.package-manager }} + cache-dependency-path: ${{ inputs.cache-dependency-path }} + + - name: Install Angular CLI (npm) + if: ${{ inputs.package-manager == 'npm' || inputs.package-manager == '' }} + shell: bash + run: npm install -g @angular/cli@${{ inputs.version }} + + - name: Install Angular CLI (pnpm) + if: ${{ inputs.package-manager == 'pnpm' }} + shell: bash + run: pnpm add -g @angular/cli@${{ inputs.version }} + + - name: Install Angular CLI (yarn) + if: ${{ inputs.package-manager == 'yarn' }} + shell: bash + run: yarn global add @angular/cli@${{ inputs.version }} + + - name: Get Angular CLI version + id: get-version + shell: bash + run: | + CLI_VERSION=$(ng version 2>/dev/null | grep -i 'Angular CLI:' | awk '{print $NF}' || echo "unknown") + echo "cli-version=$CLI_VERSION" >> "$GITHUB_OUTPUT" +``` + +- [ ] **Step 2: Verify YAML is valid** + +```bash +cd /Users/mayurrawte/github-angular-actions +python3 -c "import yaml; yaml.safe_load(open('action.yml'))" && echo "YAML valid" +``` + +Expected: `YAML valid` + +- [ ] **Step 3: Commit** + +```bash +git add action.yml +git commit -m "feat: convert to composite action with node-version and package-manager inputs" +``` + +--- + +## Task 3: Delete obsolete files + +**Files:** +- Delete: `src/action.ts`, `dist/action.js`, `package.json`, `package-lock.json`, `tsconfig.json` + +- [ ] **Step 1: Remove the TypeScript source and compiled dist** + +```bash +cd /Users/mayurrawte/github-angular-actions +git rm src/action.ts dist/action.js package.json package-lock.json tsconfig.json +``` + +Expected: output like `rm 'src/action.ts'`, `rm 'dist/action.js'` etc. + +- [ ] **Step 2: Verify only the right files remain** + +```bash +git status +find . -not -path './.git/*' -not -path './docs/*' -not -path './node_modules/*' -type f | sort +``` + +Expected files remaining: +``` +./.gitignore +./action.yml +./README.md +./docs/superpowers/plans/2026-05-21-v2-composite-action.md +``` + +- [ ] **Step 3: Commit** + +```bash +git commit -m "chore: remove obsolete TypeScript source, dist, and npm files" +``` + +--- + +## Task 4: Write integration test workflow + +**Files:** +- Create: `.github/workflows/test.yml` + +- [ ] **Step 1: Create the workflows directory** + +```bash +mkdir -p /Users/mayurrawte/github-angular-actions/.github/workflows +``` + +- [ ] **Step 2: Write the test workflow** + +```yaml +# .github/workflows/test.yml +name: Test Action + +on: + push: + branches: [master, main, 'feat/**'] + pull_request: + branches: [master, main] + +jobs: + test-npm: + name: Test — npm + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run action with npm (default) + id: setup + uses: ./ + with: + version: 'latest' + node-version: '22' + package-manager: 'npm' + + - name: Verify CLI version output is set + shell: bash + run: | + echo "CLI version: ${{ steps.setup.outputs.cli-version }}" + if [ "${{ steps.setup.outputs.cli-version }}" = "unknown" ]; then + echo "ERROR: cli-version output was 'unknown'" + exit 1 + fi + + - name: Verify ng is on PATH + shell: bash + run: ng version + + test-pnpm: + name: Test — pnpm + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run action with pnpm + id: setup + uses: ./ + with: + version: 'latest' + node-version: '22' + package-manager: 'pnpm' + + - name: Verify CLI version output is set + shell: bash + run: | + echo "CLI version: ${{ steps.setup.outputs.cli-version }}" + if [ "${{ steps.setup.outputs.cli-version }}" = "unknown" ]; then + echo "ERROR: cli-version output was 'unknown'" + exit 1 + fi + + - name: Verify ng is on PATH + shell: bash + run: ng version + + test-yarn: + name: Test — yarn + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run action with yarn + id: setup + uses: ./ + with: + version: 'latest' + node-version: '22' + package-manager: 'yarn' + + - name: Verify CLI version output is set + shell: bash + run: | + echo "CLI version: ${{ steps.setup.outputs.cli-version }}" + if [ "${{ steps.setup.outputs.cli-version }}" = "unknown" ]; then + echo "ERROR: cli-version output was 'unknown'" + exit 1 + fi + + - name: Verify ng is on PATH + shell: bash + run: ng version + + test-pinned-version: + name: Test — pinned Angular version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run action with pinned Angular CLI version + id: setup + uses: ./ + with: + version: '17.3.8' + node-version: '20' + package-manager: 'npm' + + - name: Verify the correct version was installed + shell: bash + run: | + INSTALLED="${{ steps.setup.outputs.cli-version }}" + echo "Installed: $INSTALLED" + if [ "$INSTALLED" != "17.3.8" ]; then + echo "ERROR: expected 17.3.8, got $INSTALLED" + exit 1 + fi +``` + +- [ ] **Step 3: Verify YAML is valid** + +```bash +python3 -c "import yaml; yaml.safe_load(open('/Users/mayurrawte/github-angular-actions/.github/workflows/test.yml'))" && echo "YAML valid" +``` + +Expected: `YAML valid` + +- [ ] **Step 4: Commit** + +```bash +cd /Users/mayurrawte/github-angular-actions +git add .github/workflows/test.yml +git commit -m "test: add integration test workflow for npm, pnpm, yarn, and pinned version" +``` + +--- + +## Task 5: Update README + +**Files:** +- Rewrite: `README.md` + +- [ ] **Step 1: Overwrite README.md** + +```markdown +# Angular Github Actions + +[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/) +![Test Action](https://github.com/mayurrawte/github-angular-actions/actions/workflows/test.yml/badge.svg) + +> GitHub Action to set up Node.js, cache your package manager, and install Angular CLI — all in one step. +> Supports **npm**, **yarn**, and **pnpm**. + +--- + +## Quick start + +```yml +- uses: mayurrawte/github-angular-actions@v2 +``` + +That's it. Installs the latest Angular CLI with Node 22 and npm caching enabled by default. + +--- + +## Inputs + +| Input | Required | Default | Description | +|-------|----------|---------|-------------| +| `version` | No | `latest` | Angular CLI version to install (e.g. `17.3.8`, `18.0.0`, `latest`) | +| `node-version` | No | `22` | Node.js version (e.g. `22`, `20`, `18`) | +| `package-manager` | No | `npm` | Package manager: `npm`, `yarn`, or `pnpm` | +| `cache-dependency-path` | No | _(repo root)_ | Path to lock file for caching (useful for monorepos) | + +## Outputs + +| Output | Description | +|--------|-------------| +| `cli-version` | The installed Angular CLI version string (e.g. `17.3.8`) | + +--- + +## Examples + +### Minimal — latest everything + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + - run: npm ci + - run: npm run build +``` + +### Pin Angular CLI and Node versions + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + version: '17.3.8' + node-version: '20' + - run: npm ci + - run: npm test -- --watch=false --browsers=ChromeHeadless +``` + +### Use pnpm + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + node-version: '22' + package-manager: 'pnpm' + - run: pnpm install + - run: pnpm build +``` + +### Use yarn + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + node-version: '22' + package-manager: 'yarn' + - run: yarn install --frozen-lockfile + - run: yarn build +``` + +### Monorepo — lock file in a subdirectory + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + with: + package-manager: 'npm' + cache-dependency-path: 'packages/app/package-lock.json' + - run: npm ci --workspace=packages/app +``` + +### Capture the installed CLI version + +```yml +steps: + - uses: actions/checkout@v4 + - uses: mayurrawte/github-angular-actions@v2 + id: ng-setup + with: + version: 'latest' + - run: echo "Installed Angular CLI ${{ steps.ng-setup.outputs.cli-version }}" +``` + +--- + +## When to use this vs `actions/setup-node` + +Use this action when you want a **globally installed Angular CLI** at a specific version — common in: +- Legacy projects that run `ng` directly in CI scripts +- Shared runner environments where multiple Angular projects need the same CLI +- Environments where `@angular/cli` is not a devDependency + +If `@angular/cli` is already in your `package.json` devDependencies (most modern projects), `actions/setup-node@v4` with `cache: npm` is sufficient — you don't need this action. + +--- + +## License + +MIT +``` + +- [ ] **Step 2: Commit** + +```bash +cd /Users/mayurrawte/github-angular-actions +git add README.md +git commit -m "docs: rewrite README with v2 inputs, pnpm/yarn examples, and usage guidance" +``` + +--- + +## Task 6: Tag and push + +- [ ] **Step 1: Verify the full diff looks right** + +```bash +cd /Users/mayurrawte/github-angular-actions +git log --oneline +git diff master..HEAD --stat +``` + +Expected: 4 commits since master, touching `action.yml`, removed src/dist/package files, new test workflow, updated README. + +- [ ] **Step 2: Push the feature branch** + +```bash +cd /Users/mayurrawte/github-angular-actions +git push origin feat/v2-composite-action +``` + +- [ ] **Step 3: Open a PR (or merge directly to master)** + +If opening a PR: +```bash +gh pr create \ + --title "feat: v2.0 — composite action with pnpm/yarn/node-version support" \ + --body "## What's changed + +- Converted from Node.js action to composite action (no compilation step) +- Added \`node-version\` input (default: \`22\`) +- Added \`package-manager\` input — supports \`npm\`, \`yarn\`, \`pnpm\` +- Added \`cache-dependency-path\` input for monorepos +- Removed obsolete TypeScript source, dist, and package files +- Added integration test workflow testing all three package managers +- Updated README with full examples" \ + --base master +``` + +- [ ] **Step 4: After merging to master, tag v2.0.0** + +```bash +git checkout master +git pull origin master +git tag v2.0.0 +git tag v2 # floating tag — users pin to @v2 +git push origin v2.0.0 v2 +``` + +--- + +## Self-review checklist + +- [x] All new inputs (`node-version`, `package-manager`, `cache-dependency-path`) have defaults → backwards compatible, existing users don't break +- [x] `pnpm/action-setup` step only runs when `package-manager == 'pnpm'` — no side effects for npm/yarn users +- [x] `cli-version` output wired through `steps.get-version.outputs.cli-version` from the composite's output block +- [x] Test workflow covers all three package managers + pinned CLI version +- [x] README `uses:` reference updated from `actions/angular-github-actions` to `mayurrawte/github-angular-actions@v2` +- [x] No TypeScript files referenced anywhere after deletion +- [x] No placeholder steps — all code blocks are complete diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 59c39ca..0000000 --- a/package-lock.json +++ /dev/null @@ -1,442 +0,0 @@ -{ - "name": "angular-github-actions", - "version": "1.1.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "angular-github-actions", - "version": "1.1.0", - "license": "ISC", - "dependencies": { - "@actions/core": "^1.10.0", - "@actions/github": "^5.1.1", - "@types/node": "^18.11.3" - } - }, - "node_modules/@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", - "dependencies": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" - } - }, - "node_modules/@actions/github": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz", - "integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==", - "dependencies": { - "@actions/http-client": "^2.0.1", - "@octokit/core": "^3.6.0", - "@octokit/plugin-paginate-rest": "^2.17.0", - "@octokit/plugin-rest-endpoint-methods": "^5.13.0" - } - }, - "node_modules/@actions/http-client": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", - "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", - "dependencies": { - "tunnel": "^0.0.6" - } - }, - "node_modules/@octokit/auth-token": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", - "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", - "dependencies": { - "@octokit/types": "^6.0.3" - } - }, - "node_modules/@octokit/core": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", - "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", - "dependencies": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.3", - "@octokit/request-error": "^2.0.5", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", - "dependencies": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/graphql": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", - "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", - "dependencies": { - "@octokit/request": "^5.6.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/openapi-types": { - "version": "12.11.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", - "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==" - }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "2.21.3", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz", - "integrity": "sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==", - "dependencies": { - "@octokit/types": "^6.40.0" - }, - "peerDependencies": { - "@octokit/core": ">=2" - } - }, - "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "5.16.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz", - "integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==", - "dependencies": { - "@octokit/types": "^6.39.0", - "deprecation": "^2.3.1" - }, - "peerDependencies": { - "@octokit/core": ">=3" - } - }, - "node_modules/@octokit/request": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", - "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", - "dependencies": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", - "dependencies": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "node_modules/@octokit/types": { - "version": "6.41.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", - "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", - "dependencies": { - "@octokit/openapi-types": "^12.11.0" - } - }, - "node_modules/@types/node": { - "version": "18.11.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.3.tgz", - "integrity": "sha512-fNjDQzzOsZeKZu5NATgXUPsaFaTxeRgFXoosrHivTl8RGeV733OLawXsGfEk9a8/tySyZUyiZ6E8LcjPFZ2y1A==" - }, - "node_modules/before-after-hook": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", - "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" - }, - "node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" - } - }, - "node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - } - }, - "dependencies": { - "@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", - "requires": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" - } - }, - "@actions/github": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz", - "integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==", - "requires": { - "@actions/http-client": "^2.0.1", - "@octokit/core": "^3.6.0", - "@octokit/plugin-paginate-rest": "^2.17.0", - "@octokit/plugin-rest-endpoint-methods": "^5.13.0" - } - }, - "@actions/http-client": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", - "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", - "requires": { - "tunnel": "^0.0.6" - } - }, - "@octokit/auth-token": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", - "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", - "requires": { - "@octokit/types": "^6.0.3" - } - }, - "@octokit/core": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", - "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", - "requires": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.3", - "@octokit/request-error": "^2.0.5", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", - "requires": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/graphql": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", - "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", - "requires": { - "@octokit/request": "^5.6.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/openapi-types": { - "version": "12.11.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", - "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==" - }, - "@octokit/plugin-paginate-rest": { - "version": "2.21.3", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz", - "integrity": "sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==", - "requires": { - "@octokit/types": "^6.40.0" - } - }, - "@octokit/plugin-rest-endpoint-methods": { - "version": "5.16.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz", - "integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==", - "requires": { - "@octokit/types": "^6.39.0", - "deprecation": "^2.3.1" - } - }, - "@octokit/request": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", - "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", - "requires": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", - "requires": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "@octokit/types": { - "version": "6.41.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", - "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", - "requires": { - "@octokit/openapi-types": "^12.11.0" - } - }, - "@types/node": { - "version": "18.11.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.3.tgz", - "integrity": "sha512-fNjDQzzOsZeKZu5NATgXUPsaFaTxeRgFXoosrHivTl8RGeV733OLawXsGfEk9a8/tySyZUyiZ6E8LcjPFZ2y1A==" - }, - "before-after-hook": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", - "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" - }, - "deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { - "wrappy": "1" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" - }, - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index de16b57..0000000 --- a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "angular-github-actions", - "version": "1.2.0", - "description": "Action to provide node and angular environment .", - "main": "dist/action.js", - "scripts": { - "build": "tsc", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "Mayur Rawte ", - "license": "ISC", - "dependencies": { - "@actions/core": "^1.10.0", - "@actions/github": "^5.1.1", - "@actions/cache": "^3.2.0", - "@types/node": "^18.11.3" - } -} diff --git a/src/action.ts b/src/action.ts deleted file mode 100644 index 9b8e756..0000000 --- a/src/action.ts +++ /dev/null @@ -1,35 +0,0 @@ -import * as core from '@actions/core'; -import * as cache from '@actions/cache'; -import { execSync } from 'child_process'; - -async function run() { - let version = core.getInput('version') || 'latest'; - core.info(`Installing Angular CLI @${version}`); - - const npmCachePath = execSync('npm config get cache').toString().trim(); - try { - await cache.restoreCache([npmCachePath], `npm-cache-${process.platform}-${process.arch}`); - } catch (e) { - core.debug(`Cache restore failed: ${e}`); - } - - const installOutput = execSync(`npm install -g @angular/cli@${version}`).toString(); - core.setOutput('installation-output', installOutput); - - let cliVersion = 'unknown'; - try { - const json = execSync('npx ng version --json').toString(); - cliVersion = JSON.parse(json).cli.version; - } catch (e) { - core.warning(`Could not determine Angular CLI version: ${e}`); - } - core.setOutput('cli-version', cliVersion); - - try { - await cache.saveCache([npmCachePath], `npm-cache-${process.platform}-${process.arch}`); - } catch (e) { - core.debug(`Cache save failed: ${e}`); - } -} - -run().catch(err => core.setFailed(err.message)); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 34451ba..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "allowJs": true, - "target": "ES2018", - "esModuleInterop": true, - "moduleResolution": "node" - }, - "include": [ - "./src/**/*" - ] -} \ No newline at end of file