Skip to content

Commit 94174be

Browse files
authored
ci: select angular version from @angular/core version in package.json (#4449)
1 parent 5378f8c commit 94174be

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ on:
1313
cache-mode:
1414
required: true
1515
type: string
16-
angular-versions:
17-
required: false
18-
type: string
19-
default: '^20'
20-
description: "Comma-separated Angular version constraints (e.g. '^19,^20')"
2116
secrets:
2217
NX_KEY:
2318
required: true
@@ -153,7 +148,6 @@ jobs:
153148
with:
154149
ref: ${{ inputs.ref && inputs.ref || github.sha }}
155150
node-versions: '22.21.x'
156-
angular-versions: ${{ inputs.angular-versions }}
157151
secrets:
158152
NX_KEY: ${{ secrets.NX_KEY }}
159153
AZURE_NX_CACHE_READONLY_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING || secrets.AZURE_NX_CACHE_READONLY_CONNECTION_STRING }}

.github/workflows/test-commerce-schematic.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ on:
1414
angular-versions:
1515
required: false
1616
type: string
17-
default: '^20'
18-
description: "Comma-separated Angular version constraints (e.g. '^19,^20')"
17+
description: "Comma-separated Angular version constraints (e.g. '^19,^20'). Defaults to the @angular/core version in package.json."
1918
secrets:
2019
NX_KEY:
2120
required: true
@@ -41,6 +40,12 @@ jobs:
4140
fetch-depth: 100
4241
ref: ${{ inputs.ref && inputs.ref || github.sha }}
4342

43+
- name: Get Angular version from package.json
44+
id: package-angular-version
45+
run: |
46+
VERSION=$(jq -r '.dependencies["@angular/core"]' package.json | sed -E 's/\.[0-9]+\.[0-9]+//g; s/ *\|\| */,/g')
47+
echo "angular-versions=${VERSION}" >> "$GITHUB_OUTPUT"
48+
4449
- run: git fetch origin ${{ github.base_ref }}
4550
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
4651

@@ -59,7 +64,7 @@ jobs:
5964
id: matrix
6065
with:
6166
changed-files: ${{ steps.changed.outputs.files }}
62-
angular-versions: ${{ inputs.angular-versions }}
67+
angular-versions: ${{ inputs.angular-versions || steps.package-angular-version.outputs.angular-versions }}
6368
node-versions: ${{ inputs.node-versions }}
6469

6570
test:

0 commit comments

Comments
 (0)