code-foundry 0.34.6 → 0.34.8

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.
@@ -37,19 +37,30 @@ jobs:
37
37
  fetch-depth: 0
38
38
  filter: blob:none
39
39
 
40
+ - name: Configure git auth for blob fetch
41
+ # The partial clone (filter: blob:none) defers blob downloads, so the
42
+ # merge-base/diff comparison below can trigger a promisor fetch. With
43
+ # persist-credentials disabled, git has no auth for that fetch; configure
44
+ # the credential helper with the same token the Check step uses. The token
45
+ # is scoped to contents: read, so this never enables write credentials.
46
+ env:
47
+ GH_TOKEN: ${{ secrets.CODE_FOUNDRY_TOKEN || secrets.RELEASE_PLEASE_TOKEN || github.token }}
48
+ run: gh auth setup-git
49
+
40
50
  - name: Check
41
51
  id: check-pr
42
52
  env:
43
53
  GH_TOKEN: ${{ secrets.CODE_FOUNDRY_TOKEN || secrets.RELEASE_PLEASE_TOKEN || github.token }}
44
54
  run: |
45
55
  set -euo pipefail
46
- EXISTING=$(gh pr list \
47
- --repo "$GITHUB_REPOSITORY" \
48
- --limit 1 \
49
- --base main \
50
- --head staging \
51
- --state open \
52
- --json number | node -e 'let d=""; process.stdin.on("data", c => d += c).on("end", () => console.log(JSON.parse(d || "[]").length))')
56
+ # The existing-promotion-PR lookup uses authenticated REST (gh api)
57
+ # rather than gh pr list, which issues a GraphQL query that
58
+ # NiftyLeague's long-lived fine-grained token policy rejects. The
59
+ # REST query keeps the exact base/head/state filter and the per_page=1
60
+ # cap (existing is 0 or 1) and fails closed on any API error.
61
+ EXISTING=$(gh api \
62
+ "repos/${GITHUB_REPOSITORY}/pulls?base=main&head=staging&state=open&per_page=1" \
63
+ --jq 'length')
53
64
  MAIN_TREE=$(gh api "repos/${GITHUB_REPOSITORY}/commits/main" --jq '.commit.tree.sha')
54
65
  STAGING_TREE=$(gh api "repos/${GITHUB_REPOSITORY}/commits/staging" --jq '.commit.tree.sha')
55
66
  TREE_EQUAL=false
@@ -176,26 +187,31 @@ jobs:
176
187
  - After merge, Release Please opens a separate versioned release PR with the changelog.
177
188
  EOF
178
189
 
179
- DRAFT_ARGS=()
190
+ # Creation uses authenticated REST (gh api POST) rather than
191
+ # `gh pr create`, which issues a GraphQL mutation that
192
+ # NiftyLeague's long-lived fine-grained token policy rejects. The
193
+ # REST payload keeps the exact base/head/title/body fields, adds
194
+ # draft=true only when no automation token is configured, and stays
195
+ # fail-closed through the create-race fallback below.
196
+ CREATE_ARGS=(
197
+ "repos/${GITHUB_REPOSITORY}/pulls"
198
+ --method POST
199
+ --field base=main
200
+ --field head=staging
201
+ --field title="Promote staging -> main ($DATE)"
202
+ --field body=@"$BODY_FILE"
203
+ )
180
204
  if [ "$HAS_AUTOMATION_TOKEN" != true ]; then
181
- DRAFT_ARGS+=(--draft)
205
+ CREATE_ARGS+=(--field draft=true)
182
206
  echo "::notice title=Manual PR readiness required::Created draft promotion PR because no automation token is configured. Configure CODE_FOUNDRY_TOKEN or RELEASE_PLEASE_TOKEN, or mark this PR ready manually to trigger validation."
183
207
  fi
184
208
 
185
- if ! gh pr create \
186
- --repo "$GITHUB_REPOSITORY" \
187
- --base main \
188
- --head staging \
189
- "${DRAFT_ARGS[@]}" \
190
- --title "Promote staging -> main ($DATE)" \
191
- --body-file "$BODY_FILE"; then
192
- EXISTING_NUMBER=$(gh pr list \
193
- --repo "$GITHUB_REPOSITORY" \
194
- --limit 1 \
195
- --base main \
196
- --head staging \
197
- --state open \
198
- --json number \
209
+ if ! gh api "${CREATE_ARGS[@]}"; then
210
+ # The create-race lookup uses the same authenticated REST query as
211
+ # the Check step; gh pr list issues a GraphQL query that
212
+ # NiftyLeague's long-lived fine-grained token policy rejects.
213
+ EXISTING_NUMBER=$(gh api \
214
+ "repos/${GITHUB_REPOSITORY}/pulls?base=main&head=staging&state=open&per_page=1" \
199
215
  --jq '.[0].number // empty')
200
216
  if [ -z "$EXISTING_NUMBER" ]; then
201
217
  echo 'Pull request creation failed and no existing promotion PR was found.' >&2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.34.8](https://github.com/0xPlayerOne/code-foundry/compare/v0.34.7...v0.34.8) (2026-08-02)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **ci:** create promotion PRs through REST ([c123e21](https://github.com/0xPlayerOne/code-foundry/commit/c123e21e868de685a91de228ca57cf6614767bb7))
9
+
10
+ ## [0.34.7](https://github.com/0xPlayerOne/code-foundry/compare/v0.34.6...v0.34.7) (2026-08-02)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **release:** authenticate partial clone comparisons ([172dfbe](https://github.com/0xPlayerOne/code-foundry/commit/172dfbef53ab1a9eee44cf68f648889ae99b93b1))
16
+
3
17
  ## [0.34.6](https://github.com/0xPlayerOne/code-foundry/compare/v0.34.5...v0.34.6) (2026-08-02)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.34.6",
3
+ "version": "0.34.8",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",