Skip to content

Commit 9aab12c

Browse files
Merge pull request #148 from Max-Health-Inc/develop
πŸš€ Promote develop β†’ main
2 parents 7b6979a + 34cc08b commit 9aab12c

67 files changed

Lines changed: 673 additions & 353 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.github/workflows/_parity-tests.ymlβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ on:
2727
# In local dev, babelfhir-ts defaults to ~/.fhir/packages/ (shared with HL7 Validator).
2828
env:
2929
FHIR_CACHE_ROOT: .cache
30+
# @max-health-inc/config is installed from GitHub Packages (see .npmrc), which needs a
31+
# token even though the package is public. Set at workflow level so every `npm ci` in
32+
# every job below is covered, including the one that installs inside packages/zod.
33+
# Callers MUST pass `secrets: inherit` β€” a reusable workflow sees no secrets otherwise,
34+
# and an unset secret expands to an EMPTY string that fails with a 401 identical to a bad
35+
# token. Nothing here publishes, so a repo-wide NODE_AUTH_TOKEN is safe; the release
36+
# workflows scope theirs to the install step so it cannot reach `npm publish`.
37+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
3038

3139
jobs:
3240
# ── Resolve validator versions ─────────────────────────────────────────────
@@ -105,6 +113,9 @@ jobs:
105113
internal:
106114
needs: [setup]
107115
runs-on: ubuntu-latest
116+
# Generates the packages the other two jobs reuse, so it is the longest of the
117+
# three; bounded for the same reason as hl7 below.
118+
timeout-minutes: 45
108119
permissions:
109120
contents: read
110121
strategy:
@@ -231,6 +242,9 @@ jobs:
231242
needs: [setup, internal, resolve-versions]
232243
if: ${{ !cancelled() }}
233244
runs-on: ubuntu-latest
245+
# Same exposure as hl7: an external validator subprocess that can stall on the
246+
# network with no output.
247+
timeout-minutes: 30
234248
permissions:
235249
contents: read
236250
strategy:
@@ -360,6 +374,11 @@ jobs:
360374
needs: [setup, internal, resolve-versions]
361375
if: ${{ !cancelled() }}
362376
runs-on: ubuntu-latest
377+
# The external validator runs as a subprocess with no output while it works, so
378+
# a network stall inside it reads as a live job. Without a bound it inherits
379+
# GitHub's 6-hour default: one hl7 (ips) job sat for 30+ minutes on nothing
380+
# before being cancelled by hand. A whole package takes single-digit minutes.
381+
timeout-minutes: 30
363382
permissions:
364383
contents: read
365384
strategy:

β€Ž.github/workflows/_release.ymlβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ jobs:
5050
registry-url: 'https://registry.npmjs.org'
5151

5252
- name: Install dependencies
53+
# Scoped to THIS step on purpose. setup-node above wrote
54+
# `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}` into the project .npmrc, so a
55+
# workflow-level NODE_AUTH_TOKEN would be sent to npmjs.org by `npm publish` below β€”
56+
# a GitHub token is not valid there, and it would override the OIDC trusted publishing
57+
# this workflow relies on. Here it only authenticates the @max-health-inc scope in the
58+
# committed .npmrc (GitHub Packages needs a token even for a public package).
59+
env:
60+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
5361
run: npm ci
5462

5563
- name: Update npm to latest (required for OIDC)

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
pull_request:
77
branches: [develop, main]
88

9+
# @max-health-inc/config is installed from GitHub Packages (see .npmrc), which needs a token
10+
# even though the package is public. Set at workflow level so every `npm ci` below is covered.
11+
# An unset secret expands to an EMPTY string and fails with a 401 identical to a bad token.
12+
# Nothing in this workflow publishes, so a workflow-wide NODE_AUTH_TOKEN is safe here.
13+
env:
14+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
15+
916
jobs:
1017
test:
1118
runs-on: ubuntu-latest

β€Ž.github/workflows/deploy-docs.ymlβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ on:
1010
- 'package.json'
1111
workflow_dispatch:
1212

13+
# @max-health-inc/config is installed from GitHub Packages (see .npmrc), which needs a token
14+
# even though the package is public. Set at workflow level so every `npm ci` below is covered.
15+
# An unset secret expands to an EMPTY string and fails with a 401 identical to a bad token.
16+
# Nothing in this workflow publishes, so a workflow-wide NODE_AUTH_TOKEN is safe here.
17+
env:
18+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
19+
1320
jobs:
1421
deploy-docs:
1522
runs-on: ubuntu-latest

β€Ž.github/workflows/pipeline-parity-develop.ymlβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,20 @@ concurrency:
2323
group: parity-develop-${{ github.ref }}
2424
cancel-in-progress: false
2525

26+
# @max-health-inc/config is installed from GitHub Packages (see .npmrc), which needs a token
27+
# even though the package is public. Set at workflow level so every `npm ci` below is covered.
28+
# An unset secret expands to an EMPTY string and fails with a 401 identical to a bad token.
29+
# Nothing in this workflow publishes, so a workflow-wide NODE_AUTH_TOKEN is safe here.
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
32+
2633
jobs:
2734
# ── Run both validators in parallel (reusable workflow) ────────────────────
2835
parity-tests:
2936
uses: ./.github/workflows/_parity-tests.yml
37+
# Required: the reusable workflow's `npm ci` needs GH_PACKAGES_TOKEN to fetch
38+
# @max-health-inc/config, and a called workflow sees NO secrets without this.
39+
secrets: inherit
3040
with:
3141
packages: ${{ github.event.inputs.packages || 'all' }}
3242
validator_version: ${{ github.event.inputs.validator_version || 'latest' }}

β€Ž.github/workflows/pipeline-parity-main.ymlβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,20 @@ on:
1919
required: false
2020
default: 'latest'
2121

22+
# @max-health-inc/config is installed from GitHub Packages (see .npmrc), which needs a token
23+
# even though the package is public. Set at workflow level so every `npm ci` below is covered.
24+
# An unset secret expands to an EMPTY string and fails with a 401 identical to a bad token.
25+
# Nothing in this workflow publishes, so a workflow-wide NODE_AUTH_TOKEN is safe here.
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
28+
2229
jobs:
2330
# ── Run both validators in parallel (reusable workflow) ────────────────────
2431
parity-tests:
2532
uses: ./.github/workflows/_parity-tests.yml
33+
# Required: the reusable workflow's `npm ci` needs GH_PACKAGES_TOKEN to fetch
34+
# @max-health-inc/config, and a called workflow sees NO secrets without this.
35+
secrets: inherit
2636
with:
2737
packages: ${{ github.event.inputs.packages || 'all' }}
2838
validator_version: ${{ github.event.inputs.validator_version || 'latest' }}

β€Ž.github/workflows/prerelease-develop.ymlβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
- develop
77
workflow_dispatch:
88

9+
# @max-health-inc/config is installed from GitHub Packages (see .npmrc), which needs a token
10+
# even though the package is public. Set at workflow level so every `npm ci` below is covered.
11+
# An unset secret expands to an EMPTY string and fails with a 401 identical to a bad token.
12+
# Nothing in this workflow publishes, so a workflow-wide NODE_AUTH_TOKEN is safe here.
13+
env:
14+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
15+
916
jobs:
1017
prerelease:
1118
runs-on: ubuntu-latest

β€Ž.github/workflows/release.ymlβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ jobs:
5656
registry-url: 'https://registry.npmjs.org'
5757

5858
- name: Install dependencies
59+
# Scoped to THIS step on purpose. setup-node above wrote
60+
# `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}` into the project .npmrc, so a
61+
# workflow-level NODE_AUTH_TOKEN would be sent to npmjs.org by `npm publish` below β€”
62+
# a GitHub token is not valid there, and it would override the OIDC trusted publishing
63+
# this workflow relies on. Here it only authenticates the @max-health-inc scope in the
64+
# committed .npmrc (GitHub Packages needs a token even for a public package).
65+
env:
66+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
5967
run: npm ci
6068

6169
- name: Update npm to latest (required for OIDC)

β€Ž.github/workflows/self-heal.ymlβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ permissions:
2525
contents: write
2626
actions: read
2727

28+
# @max-health-inc/config is installed from GitHub Packages (see .npmrc), which needs a token
29+
# even though the package is public. Set at workflow level so every `npm ci` below is covered.
30+
# An unset secret expands to an EMPTY string and fails with a 401 identical to a bad token.
31+
# Nothing in this workflow publishes, so a workflow-wide NODE_AUTH_TOKEN is safe here.
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
34+
2835
jobs:
2936
self-heal:
3037
name: Auto-Fix Test Failures

β€Ž.npmrcβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# @max-health-inc/config comes from the GitHub Packages npm registry, not npmjs.org. A
2+
# GitHub Packages scope resolves to the OWNER hosting it, so the scope must be mapped
3+
# explicitly β€” without this line npm resolves @max-health-inc/* against registry.npmjs.org
4+
# and 404s.
5+
#
6+
# npm substitutes ${NODE_AUTH_TOKEN} at install time, so no token is committed. CI supplies
7+
# it as GH_PACKAGES_TOKEN on every `npm ci` step; locally, `gh auth token` works. The
8+
# registry requires a token even though the package is PUBLIC.
9+
#
10+
# Everything else this repo installs, and everything it PUBLISHES (@babelfhir-ts/* ->
11+
# registry.npmjs.org, see _release.yml), is unaffected: only this one scope is redirected.
12+
@max-health-inc:registry=https://npm.pkg.github.com
13+
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}

0 commit comments

Comments
Β (0)