@norskvideo/ctl-dev-kit 0.1.22 → 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.
@@ -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.22",
3
+ "version": "0.1.23",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",