@norskvideo/ctl-dev-kit 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,6 +40,12 @@ jobs:
40
40
  run: |
41
41
  nix develop .#build --command bash -c '
42
42
  set -euo pipefail
43
+ # clean:false persists node_modules between runs, and a frozen install
44
+ # will NOT relink a dep/workspace whose pinned version moved -- e.g. a
45
+ # dev-kit bump leaves a stale node_modules/@norskvideo/ctl-dev-kit, so
46
+ # check:drift would run the OLD checker against the new canonical. Nuke
47
+ # every node_modules first so the pinned versions are what actually run.
48
+ find . -name node_modules -type d -prune -exec rm -rf {} + 2>/dev/null || true
43
49
  bun install --frozen-lockfile
44
50
  bun run check:drift
45
51
  '
@@ -58,6 +64,12 @@ jobs:
58
64
  run: |
59
65
  nix develop .#build --command bash -c '
60
66
  set -euo pipefail
67
+ # clean:false persists node_modules between runs, and a frozen install
68
+ # will NOT relink a dep/workspace whose pinned version moved -- e.g. a
69
+ # dev-kit bump leaves a stale node_modules/@norskvideo/ctl-dev-kit, so
70
+ # check:drift would run the OLD checker against the new canonical. Nuke
71
+ # every node_modules first so the pinned versions are what actually run.
72
+ find . -name node_modules -type d -prune -exec rm -rf {} + 2>/dev/null || true
61
73
  bun install --frozen-lockfile
62
74
  bun run lint
63
75
  bun run typecheck
@@ -138,7 +138,7 @@ jobs:
138
138
  - name: Open a reconciliation PR (gate red)
139
139
  if: steps.sync.outputs.changed == '1' && steps.gate.outcome == 'failure'
140
140
  env:
141
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141
+ API_TOKEN: ${{ secrets.CI_DISPATCH_TOKEN }}
142
142
  run: |
143
143
  set -euo pipefail
144
144
  branch="sync-dev-kit/${{ steps.sync.outputs.new }}"
@@ -162,10 +162,22 @@ jobs:
162
162
  " bun run lint && bun run typecheck && bun run test:unit # a convention that breaks real code" \
163
163
  "" \
164
164
  "Resolve whichever is failing, pushing to this branch until green -- then merge.")"
165
- if existing="$(gh pr list --head "$branch" --state open --json number -q '.[0].number')" && [ -n "$existing" ]; then
166
- gh pr edit "$existing" --title "$title" --body "$body"
165
+ # gh is not on the self-hosted runner PATH (it lives only inside
166
+ # `nix develop`, and this step runs outside it), so create/update the PR
167
+ # straight against the REST API with the same PAT that pushed the branch.
168
+ # Using the PAT (not GITHUB_TOKEN) lets the PR's own checks run so a human
169
+ # sees the red/green. curl+jq are on the host PATH (the pin-resolve step
170
+ # above already uses them).
171
+ repo="${{ github.repository }}"; owner="${repo%%/*}"
172
+ api="https://api.github.com/repos/$repo/pulls"
173
+ curl_api=(--fail-with-body -sS -H "Authorization: Bearer $API_TOKEN" -H "Accept: application/vnd.github+json")
174
+ existing="$(curl "${curl_api[@]}" "$api?head=$owner:$branch&state=open" | jq -r '.[0].number // empty')"
175
+ if [ -n "$existing" ]; then
176
+ curl "${curl_api[@]}" -X PATCH "$api/$existing" \
177
+ --data "$(jq -nc --arg t "$title" --arg b "$body" '{title:$t, body:$b}')" >/dev/null
167
178
  else
168
- gh pr create --base main --head "$branch" --title "$title" --body "$body"
179
+ curl "${curl_api[@]}" -X POST "$api" \
180
+ --data "$(jq -nc --arg t "$title" --arg b "$body" --arg h "$branch" '{title:$t, body:$b, head:$h, base:"main"}')" >/dev/null
169
181
  fi
170
182
 
171
183
  - name: Report "already fresh"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",