Skip to content

Commit 8c9db6d

Browse files
committed
CCM-12614: add github package manager authentication
1 parent 03401e0 commit 8c9db6d

7 files changed

Lines changed: 41 additions & 15 deletions

File tree

.github/actions/build-docs/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ runs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v5
12-
- uses: actions/setup-node@v6
12+
- uses: ./.github/actions/node-install
1313
with:
14-
node-version: 24
14+
node-version: ${{ inputs.nodejs_version }}
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1516
- name: Npm cli install
1617
working-directory: ./docs
1718
run: npm ci
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Node install and setup'
2+
description: 'Setup node and authenticate github package repository'
3+
4+
inputs:
5+
node-version:
6+
description: 'Node.js version'
7+
required: true
8+
GITHUB_TOKEN:
9+
description: "Token for access to github package registry"
10+
required: true
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: 'Use Node.js'
16+
uses: actions/setup-node@v6
17+
with:
18+
node-version: '${{ inputs.node-version }}'
19+
20+
- name: "Configure npm for GitHub Packages"
21+
shell: bash
22+
env:
23+
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
24+
run: |
25+
scripts/set-github-token.sh

.github/workflows/stage-2-test.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ jobs:
5353
steps:
5454
- name: "Checkout code"
5555
uses: actions/checkout@v5
56-
- uses: actions/setup-node@v6
56+
- uses: ./.github/actions/node-install
5757
with:
58-
node-version: 24.10.0
58+
node-version: ${{ inputs.nodejs_version }}
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5960
- name: "Repo setup"
6061
run: |
6162
npm ci
@@ -70,9 +71,10 @@ jobs:
7071
steps:
7172
- name: "Checkout code"
7273
uses: actions/checkout@v5
73-
- uses: actions/setup-node@v6
74+
- uses: ./.github/actions/node-install
7475
with:
75-
node-version: 24.10.0
76+
node-version: ${{ inputs.nodejs_version }}
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7678
- uses: actions/setup-python@v6
7779
with:
7880
python-version: '3.14'
@@ -103,9 +105,10 @@ jobs:
103105
steps:
104106
- name: "Checkout code"
105107
uses: actions/checkout@v5
106-
- uses: actions/setup-node@v6
108+
- uses: ./.github/actions/node-install
107109
with:
108-
node-version: 24.10.0
110+
node-version: ${{ inputs.nodejs_version }}
111+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109112
- name: "Run linting"
110113
run: |
111114
make test-lint
@@ -118,9 +121,10 @@ jobs:
118121
steps:
119122
- name: "Checkout code"
120123
uses: actions/checkout@v5
121-
- uses: actions/setup-node@v6
124+
- uses: ./.github/actions/node-install
122125
with:
123-
node-version: 24.10.0
126+
node-version: ${{ inputs.nodejs_version }}
127+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124128
- name: "Run typecheck"
125129
run: |
126130
make test-typecheck

scripts/tests/integration.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ set -euo pipefail
44

55
cd "$(git rev-parse --show-toplevel)"
66

7-
./scripts/set-github-token.sh
8-
npm ci
7+
npm install
98
npx playwright install --with-deps > /dev/null
109

1110
cd tests/playwright

scripts/tests/lint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -euo pipefail
44

55
cd "$(git rev-parse --show-toplevel)"
66

7-
./scripts/set-github-token.sh
87
npm ci
98
npm run generate-dependencies
109
npm run lint

scripts/tests/typecheck.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -euo pipefail
44

55
cd "$(git rev-parse --show-toplevel)"
66

7-
./scripts/set-github-token.sh
87
npm ci
98
npm run generate-dependencies
109
npm run typecheck

scripts/tests/unit.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ make -C ./src/python-schema-generator coverage # Run with coverage to generate
4141

4242
# TypeScript/JavaScript projects (npm workspace)
4343
# Note: src/cloudevents is included in workspaces, so it will be tested here
44-
./scripts/set-github-token.sh
4544
npm ci
4645
npm run generate-dependencies
4746
npm run test:unit --workspaces

0 commit comments

Comments
 (0)