Skip to content

Commit 2f4fc95

Browse files
authored
Merge pull request #292 from Cox-Automotive/caiArt
move to artifactory and update alks.js to latest
2 parents f6342e0 + fec0ecc commit 2f4fc95

File tree

9 files changed

+1598
-2677
lines changed

9 files changed

+1598
-2677
lines changed

.github/workflows/build-and-test.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
build_and_test:
1414

1515
runs-on: ubuntu-latest
16-
16+
permissions:
17+
id-token: write
18+
contents: read
1719
strategy:
1820
matrix:
19-
node-version: [20.x, 22.x]
21+
node-version: [20.x, 22.x, 24.x]
2022
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2123

2224
steps:
@@ -26,12 +28,24 @@ jobs:
2628
with:
2729
node-version: ${{ matrix.node-version }}
2830

31+
- name: Set up Artifactory Auth with OIDC
32+
id: jfrog_setup
33+
uses: jfrog/setup-jfrog-cli@v4
34+
env:
35+
JF_URL: https://artifactory.coxautoinc.com
36+
with:
37+
oidc-provider-name: gh-public
38+
39+
- name: Configure npm to use Artifactory
40+
run: |
41+
jf npm-config --repo-resolve cai-npm --server-id-resolve setup-jfrog-cli-server
42+
2943
# Note: if this step is failing due to authentication errors, it is likely because you regenerated the npm-shrinkwrap.json
3044
# file while your local NPM was set to use the coxauto artifactory NPM registry. To fix this, locally delete your node_modules
3145
# folder and npm-shrinkwrap.json file, then run `npm i --registry=https://registry.npmjs.org/` to reinstall using public NPM
3246
# and then `npm shrinkwrap` to regenerate the npm-shrinkwrap.json file.
3347
- name: Install dependencies
34-
run: npm ci
48+
run: jf npm ci
3549
- run: npm run build --if-present
3650
- name: Run tests
3751
run: npm test -- --no-watch
@@ -40,6 +54,7 @@ jobs:
4054
env:
4155
REFRESH_TOKEN: ${{ secrets.ALKS_REFRESH_TOKEN }}
4256
USERNAME: ${{ secrets.ALKS_USER }}
57+
NPM_AUTH_TOKEN: ${{ steps.jfrog_setup.outputs.oidc-token }}
4358
run: |
44-
make test CI_MODE=true
59+
make test CI_MODE=true NPM_AUTH_TOKEN=${{ steps.jfrog_setup.outputs.oidc-token }}
4560
working-directory: ./e2e

.github/workflows/code-coverage.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,30 @@ jobs:
99
test-coverage:
1010
name: Upload Coverage to Sonarqube
1111
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
14+
contents: read
1215
steps:
1316
- uses: actions/checkout@v4
1417
with:
1518
fetch-depth: 0
1619
- uses: actions/setup-node@v3
1720
with:
18-
node-version: 20
21+
node-version: 24
22+
23+
- name: Set up Artifactory Auth with OIDC
24+
uses: jfrog/setup-jfrog-cli@v4
25+
env:
26+
JF_URL: https://artifactory.coxautoinc.com
27+
with:
28+
oidc-provider-name: gh-public
29+
30+
- name: Configure npm to use Artifactory
31+
run: |
32+
jf npm-config --repo-resolve cai-npm --server-id-resolve setup-jfrog-cli-server
33+
1934
- name: Install node modules
20-
run: npm ci
35+
run: jf npm ci
2136
- name: Build coverage report
2237
run: npm run coverage
2338
env:

.github/workflows/trigger-release.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424

2525
bump_version:
2626
runs-on: ubuntu-latest
27+
permissions:
28+
id-token: write
29+
contents: read
2730
needs:
2831
- get_pull_request
2932
if: ${{ contains(needs.get_pull_request.outputs.pull_request_labels, 'release/patch') || contains(needs.get_pull_request.outputs.pull_request_labels, 'release/minor') || contains(needs.get_pull_request.outputs.pull_request_labels, 'release/major') }}
@@ -35,8 +38,18 @@ jobs:
3538

3639
- uses: actions/setup-node@v2
3740
with:
38-
node-version: 16
39-
registry-url: https://registry.npmjs.org/
41+
node-version: 24
42+
43+
- name: Set up Artifactory Auth with OIDC
44+
uses: jfrog/setup-jfrog-cli@v4
45+
env:
46+
JF_URL: https://artifactory.coxautoinc.com
47+
with:
48+
oidc-provider-name: gh-public
49+
50+
- name: Configure npm to use Artifactory
51+
run: |
52+
jf npm-config --repo-resolve cai-npm --server-id-resolve setup-jfrog-cli-server
4053
4154
- name: Set github user
4255
run: |
@@ -45,7 +58,7 @@ jobs:
4558
4659
# need to run npm install before npm version so that husky's precommit hooks rebuild the dist/ folder
4760
- name: install dependencies
48-
run: npm ci
61+
run: jf npm ci
4962

5063
- name: Get the release level (major/minor/patch) from the labels
5164
uses: actions-ecosystem/action-release-label@955bf130fba6be3d99d2c14457d0dc7f176bc563
@@ -116,6 +129,11 @@ jobs:
116129
release_name: ${{ steps.previoustag.outputs.tag }}
117130
body: ${{ needs.get_pull_request.outputs.pull_request_body }}
118131

119-
- run: npm publish
120-
env:
121-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
132+
- name: Configure npm for npmjs publishing
133+
run: |
134+
echo "registry=https://registry.npmjs.org/" > .npmrc
135+
136+
- name: Publish to npm with OIDC provenance
137+
run: |
138+
unset NODE_AUTH_TOKEN
139+
npm publish --provenance --access public

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://artifactory.coxautoinc.com/artifactory/api/npm/cai-npm/

changelog.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
★ Release Notes: 2025-10-16 ★
1+
★ Release Notes: 2025-12-16 ★
22
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
33

44
Thanks for upgrading to the latest version of the ALKS CLI!
55

6-
* Allows for use of automated change ticket creation or verification when getting keys.
7-
See [ChangeMinder](https://pages.ghe.coxautoinc.com/ETS-CloudAutomation/Cloud-Platform-Docs/docs/tools_by_cloud_provider/aws/security_services/alks/changeminder) for details.
6+
* Updated alks.js dependency to latest version (2.14.9) with bug fixes and improvements.
7+
* Updated CI/CD workflows to use Artifactory for npm package registry.
88

99
Have feedback? https://github.com/Cox-Automotive/ALKS-CLI/issues
1010

dist/changelog.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
★ Release Notes: 2025-10-16 ★
1+
★ Release Notes: 2025-12-16 ★
22
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
33

44
Thanks for upgrading to the latest version of the ALKS CLI!
55

6-
* Allows for use of automated change ticket creation or verification when getting keys.
7-
See [ChangeMinder](https://pages.ghe.coxautoinc.com/ETS-CloudAutomation/Cloud-Platform-Docs/docs/tools_by_cloud_provider/aws/security_services/alks/changeminder) for details.
6+
* Updated alks.js dependency to latest version (2.14.9) with bug fixes and improvements.
7+
* Updated CI/CD workflows to use Artifactory for npm package registry.
88

99
Have feedback? https://github.com/Cox-Automotive/ALKS-CLI/issues
1010

e2e/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ ARG NODE_VERSION=18
22

33
FROM node:${NODE_VERSION}
44

5+
# Configure npm to use Artifactory
6+
ARG NPM_AUTH_TOKEN
7+
RUN npm config set registry https://artifactory.coxautoinc.com/artifactory/api/npm/cai-npm/ && \
8+
npm config set //artifactory.coxautoinc.com/artifactory/api/npm/cai-npm/:_authToken ${NPM_AUTH_TOKEN}
9+
510
# build and install cli from source
611
COPY . /alks
712
WORKDIR /alks

e2e/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
TOKEN = --build-arg REFRESH_TOKEN=$(REFRESH_TOKEN)
22
USER = --build-arg USERNAME=$(USERNAME)
3+
NPM_AUTH = --build-arg NPM_AUTH_TOKEN=$(NPM_AUTH_TOKEN)
34

45
CI_MODE = false
56
ifeq ($(CI_MODE),true)
@@ -18,7 +19,7 @@ endif
1819

1920
build:
2021
@echo "Building tester..."
21-
docker build --no-cache $(TOKEN) $(USER) -t alks-cli-test -f Dockerfile ..
22+
docker build --no-cache $(TOKEN) $(USER) $(NPM_AUTH) -t alks-cli-test -f Dockerfile ..
2223

2324
test: build
2425
@echo "running intg tests..."

0 commit comments

Comments
 (0)