Repository navigation
516 lines (476 loc) · 22.9 KB
/
Copy pathrelease-cli.yml
File metadata and controls
516 lines (476 loc) · 22.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
name: Publish CLI
on:
push:
tags:
- "cli-release-v*"
permissions:
contents: read
# DiffCI's own CI and release smoke runs are not usage; keep them out of the counts (docs/telemetry.md).
env:
DO_NOT_TRACK: "1"
jobs:
verify-muse-plugin-integrity:
name: Verify Muse marketplace package integrity
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- name: Install the checksum-verified Muse package validator
shell: bash
run: |
set -euo pipefail
readonly muse_version="1.4.11-R6667.1"
readonly muse_sha256="6fda12a6a4f236528dafa707384cf6395fe859b1438ef77c7be26ed9d7976839"
readonly muse_bin="$RUNNER_TEMP/muse"
curl --fail --location --proto '=https' --tlsv1.2 --retry 3 \
--output "$muse_bin" \
"https://lookaside.facebook.com/lookaside/muse/download/?channel=muse&version=$muse_version&file=muse-x86-linux"
echo "$muse_sha256 $muse_bin" | sha256sum --check --status
chmod 0755 "$muse_bin"
echo "MUSE_BIN=$muse_bin" >> "$GITHUB_ENV"
- name: Require the Muse marketplace digest to match its package tree
run: node scripts/check-muse-plugin-integrity.mjs
require-product-dispatch:
name: Require hosted MCP synchronizer
runs-on: ubuntu-26.04
steps:
- name: Require a working narrowly scoped product dispatch token
shell: bash
env:
GH_TOKEN: ${{ secrets.DIFFCI_PRODUCT_DISPATCH_TOKEN }}
run: |
set -euo pipefail
test -n "$GH_TOKEN" || {
echo "DIFFCI_PRODUCT_DISPATCH_TOKEN is required before publishing a release." >&2
echo "Use a fine-grained token restricted to DiffCI/DiffCI.com with Contents: write." >&2
exit 1
}
# This event is intentionally not a trigger type in the product repository. It validates
# cross-repository dispatch permission before npm, tags, or registry state can advance.
gh api --method POST repos/DiffCI/DiffCI.com/dispatches \
-f event_type=diffci-core-release-preflight \
-f "client_payload[core_run_id]=$GITHUB_RUN_ID" >/dev/null
require-gitlab-catalog-key:
name: Require GitLab catalog publisher
runs-on: ubuntu-26.04
steps:
- name: Require a working deploy key for gitlab.com/diffci/diffci
shell: bash
env:
GITLAB_DEPLOY_KEY: ${{ secrets.DIFFCI_GITLAB_DEPLOY_KEY }}
run: |
set -euo pipefail
test -n "$GITLAB_DEPLOY_KEY" || {
echo "DIFFCI_GITLAB_DEPLOY_KEY is required before publishing a release." >&2
echo "Use the private half of a deploy key on gitlab.com/diffci/diffci with write access, allowed to push to main." >&2
exit 1
}
# Deploy keys are free on GitLab.com; project access tokens need Premium.
key="$RUNNER_TEMP/gitlab_deploy_key"
# A key pasted on Windows carries CRs, which OpenSSH rejects as an invalid key.
printf '%s\n' "$GITLAB_DEPLOY_KEY" | tr -d '\r' > "$key"
chmod 0600 "$key"
# gitlab.com's published ED25519 host key (SHA256:eUXGGm1YGsMAS7vkcx6JOJdOGHPem5gQp4taiCfCLB8).
echo "gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf" > "$RUNNER_TEMP/gitlab_known_hosts"
export GIT_SSH_COMMAND="ssh -i $key -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$RUNNER_TEMP/gitlab_known_hosts"
# The public fingerprint is safe to log and must match the deploy key's in GitLab's settings.
fingerprint=$(ssh-keygen -y -f "$key" | ssh-keygen -lf - | awk '{print $2}') || {
echo "DIFFCI_GITLAB_DEPLOY_KEY is not a valid unencrypted OpenSSH private key." >&2
exit 1
}
echo "Deploy key fingerprint: $fingerprint"
# Checked before npm, tags, or registry state can advance, like the product dispatch token.
# A throwaway branch proves write access; the catalog pipeline runs on tags only.
git clone --quiet --depth 1 git@gitlab.com:diffci/diffci.git "$RUNNER_TEMP/catalog"
cd "$RUNNER_TEMP/catalog"
probe="refs/heads/release-preflight-$GITHUB_RUN_ID"
git push --quiet origin "HEAD:$probe" || {
echo "DIFFCI_GITLAB_DEPLOY_KEY can read but not write gitlab.com/diffci/diffci; enable its write access." >&2
exit 1
}
git push --quiet origin --delete "$probe"
# The release is split so the OIDC credential that npm trusted publishing accepts is never in a job that runs
# third-party code (DiffCI/core#301). While a job has id-token: write, every step can request that token, so:
# build installs, builds and packs with a read-only token and no id-token;
# publish only checks and publishes that tarball, with no install, build or lifecycle scripts;
# release does the GitHub Release, tags and smokes with contents: write and no id-token.
build:
name: Build and pack @diffci.com/diffci
runs-on: ubuntu-26.04
permissions:
contents: read
env:
GIT_SSH_COMMAND: /bin/false
outputs:
tarball: ${{ steps.pack.outputs.tarball }}
integrity: ${{ steps.pack.outputs.integrity }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
cache-dependency-path: packages/diffci-cli/package-lock.json
- name: Install the npm version that packs and publishes
run: npm install --global --ignore-scripts npm@11.21.2
- name: Require an exact release tag
working-directory: packages/diffci-cli
shell: bash
run: |
set -euo pipefail
version=$(node -p "require('./package.json').version")
expected="cli-release-v$version"
test "$GITHUB_REF_NAME" = "$expected"
- name: Install CLI dependencies
working-directory: packages/diffci-cli
run: npm ci --no-audit --fund=false
- name: Verify cross-agent package metadata
run: node scripts/check-agent-packaging.mjs
- name: Verify the release package
working-directory: packages/diffci-cli
run: |
npm run typecheck
npm run build
npm run package:check
npm run package:smoke
- name: Pack the release tarball
id: pack
working-directory: packages/diffci-cli
shell: bash
run: |
set -euo pipefail
# npm records gitHead itself only when it publishes from a git checkout. publish gets a tarball, so the
# commit goes in the packed package.json, which npm keeps. The re-run check in publish reads it back.
npm pkg set "gitHead=$GITHUB_SHA"
out="$RUNNER_TEMP/release-package"
mkdir -p "$out"
npm pack --pack-destination "$out" --json > "$RUNNER_TEMP/pack.json"
tarball=$(jq -r '.[0].filename' "$RUNNER_TEMP/pack.json")
integrity=$(jq -r '.[0].integrity' "$RUNNER_TEMP/pack.json")
test "$integrity" = "sha512-$(openssl dgst -sha512 -binary "$out/$tarball" | base64 -w0)"
echo "tarball=$tarball" >> "$GITHUB_OUTPUT"
echo "integrity=$integrity" >> "$GITHUB_OUTPUT"
echo "Packed $tarball ($integrity)"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-package
path: ${{ runner.temp }}/release-package/${{ steps.pack.outputs.tarball }}
if-no-files-found: error
retention-days: 7
publish:
name: Publish @diffci.com/diffci
needs: [build, require-product-dispatch, require-gitlab-catalog-key, verify-muse-plugin-integrity]
runs-on: ubuntu-26.04
permissions:
# Only the OIDC token npm trusted publishing exchanges. No checkout, no dependency install and no lifecycle
# scripts: nothing here runs code other than this file's steps, setup-node and the pinned npm.
id-token: write
env:
GIT_SSH_COMMAND: /bin/false
TARBALL: ${{ needs.build.outputs.tarball }}
INTEGRITY: ${{ needs.build.outputs.integrity }}
steps:
# No npm cache: a cache restored here is written by jobs that ran install scripts.
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Install the npm version that packs and publishes
run: npm install --global --ignore-scripts npm@11.21.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: release-package
path: ${{ runner.temp }}/release-package
- name: Require the tarball build packed for this tag and commit
id: package
shell: bash
run: |
set -euo pipefail
file="$RUNNER_TEMP/release-package/$TARBALL"
test "$INTEGRITY" = "sha512-$(openssl dgst -sha512 -binary "$file" | base64 -w0)" || {
echo "::error::$TARBALL does not match the integrity build recorded ($INTEGRITY)" >&2
exit 1
}
manifest=$(tar --extract --gzip --to-stdout --file "$file" package/package.json)
name=$(jq -r .name <<<"$manifest")
version=$(jq -r .version <<<"$manifest")
git_head=$(jq -r .gitHead <<<"$manifest")
test "$name" = "@diffci.com/diffci"
test "$GITHUB_REF_NAME" = "cli-release-v$version"
test "$git_head" = "$GITHUB_SHA"
echo "name=$name" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "file=$file" >> "$GITHUB_OUTPUT"
- name: Publish or verify the immutable npm package
shell: bash
env:
PACKAGE_NAME: ${{ steps.package.outputs.name }}
PACKAGE_VERSION: ${{ steps.package.outputs.version }}
PACKAGE_FILE: ${{ steps.package.outputs.file }}
run: |
set -euo pipefail
if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version >/dev/null 2>&1; then
published_git_head=$(npm view "$PACKAGE_NAME@$PACKAGE_VERSION" gitHead)
test "$published_git_head" = "$GITHUB_SHA" || {
echo "$PACKAGE_NAME@$PACKAGE_VERSION already exists but is from $published_git_head, not $GITHUB_SHA" >&2
exit 1
}
echo "$PACKAGE_NAME@$PACKAGE_VERSION is already published from this release commit; reconciling downstream surfaces."
else
npm publish "$PACKAGE_FILE" --access public --provenance --ignore-scripts
fi
- name: Wait for npm registry propagation
shell: bash
env:
PACKAGE_NAME: ${{ steps.package.outputs.name }}
PACKAGE_VERSION: ${{ steps.package.outputs.version }}
run: |
set -euo pipefail
for attempt in {1..30}; do
published_version=$(npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null || true)
if [ "$published_version" = "$PACKAGE_VERSION" ]; then
exit 0
fi
echo "Waiting for $PACKAGE_NAME@$PACKAGE_VERSION on npm ($attempt/30)"
if [ "$attempt" -lt 30 ]; then
sleep 10
fi
done
echo "$PACKAGE_NAME@$PACKAGE_VERSION was not available from npm after 290 seconds" >&2
exit 1
release:
name: Release @diffci.com/diffci on GitHub
needs: publish
runs-on: ubuntu-26.04
permissions:
# Creates the GitHub Release, attaches its assets and tags the Action through the API. No id-token.
contents: write
env:
GIT_SSH_COMMAND: /bin/false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
# The observer smoke below installs and runs the published CLI; keep the write token off disk.
# This job tags and releases through the API with GH_TOKEN, never with git push.
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Resolve the release smoke range
id: release_smoke_range
shell: bash
run: |
set -euo pipefail
echo "base=$(git rev-parse HEAD^)" >> "$GITHUB_OUTPUT"
- name: Smoke the published observer Action
id: observe
uses: ./
with:
base-sha: ${{ steps.release_smoke_range.outputs.base }}
head-sha: ${{ github.sha }}
upload-artifact: "false"
redact-paths: "true"
fail-on-error: "true"
- name: Assert observer receipt
shell: bash
env:
DIFFCI_STATUS: ${{ steps.observe.outputs.status }}
DIFFCI_REPORT_PATH: ${{ steps.observe.outputs.report-path }}
run: |
set -euo pipefail
test "$DIFFCI_STATUS" = "OBSERVED"
test -n "$DIFFCI_REPORT_PATH"
test -f "$DIFFCI_REPORT_PATH"
- name: Create the GitHub Release
working-directory: packages/diffci-cli
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
package_name=$(node -p "require('./package.json').name")
package_version=$(node -p "require('./package.json').version")
release_tag="v$package_version"
if gh release view "$release_tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
target=$(gh release view "$release_tag" --repo "$GITHUB_REPOSITORY" --json targetCommitish --jq .targetCommitish)
test "$(git rev-parse "$target")" = "$GITHUB_SHA" || {
echo "GitHub Release $release_tag targets $target, not $GITHUB_SHA" >&2
exit 1
}
echo "GitHub Release $release_tag already targets this release commit"
exit 0
fi
# Changes land on main without pull requests, so --generate-notes alone
# lists nothing; name the feat/fix commits since the previous release.
notes_file=$(mktemp)
node "$GITHUB_WORKSPACE/scripts/release-notes.mjs" "$GITHUB_SHA" "$package_name@$package_version" >"$notes_file"
gh release create "$release_tag" \
--repo "$GITHUB_REPOSITORY" \
--target "$GITHUB_SHA" \
--title "$release_tag" \
--latest \
--notes-file "$notes_file" \
--generate-notes || {
# The job token cannot create a tag on a commit whose workflow files differ from main's.
echo "::error::Could not create the $release_tag release. If main has moved past this commit with a workflow change, push the release tags from the release commit yourself (npm run release:tag) and rerun the failed jobs."
exit 1
}
- name: Attach the tarball and its signed provenance to the GitHub Release
working-directory: packages/diffci-cli
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
package_version=$(node -p "require('./package.json').version")
node "$GITHUB_WORKSPACE/scripts/attach-release-provenance.mjs" "$package_version"
- name: Tag the matching observer Action release
working-directory: packages/diffci-cli
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
action_tag="action-v$(node -p "require('./package.json').version")"
if ref=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$action_tag" 2>/dev/null); then
type=$(jq -r .object.type <<<"$ref")
sha=$(jq -r .object.sha <<<"$ref")
if [ "$type" = "tag" ]; then sha=$(gh api "repos/$GITHUB_REPOSITORY/git/tags/$sha" --jq .object.sha); fi
test "$sha" = "$GITHUB_SHA" || {
echo "Tag $action_tag targets $sha, not $GITHUB_SHA" >&2
exit 1
}
echo "Tag $action_tag already targets this release commit"
exit 0
fi
cannot_tag() {
echo "::error::Could not create $action_tag. If main has moved past this commit with a workflow change, push the release tags from the release commit yourself (npm run release:tag) and rerun the failed jobs."
exit 1
}
tag_object=$(gh api "repos/$GITHUB_REPOSITORY/git/tags" \
-f tag="$action_tag" \
-f message="Release DiffCI observer Action ${action_tag#action-}" \
-f object="$GITHUB_SHA" \
-f type=commit \
--jq .sha) || cannot_tag
gh api "repos/$GITHUB_REPOSITORY/git/refs" -f ref="refs/tags/$action_tag" -f sha="$tag_object" >/dev/null || cannot_tag
- name: Verify npm, GitHub Release and tags agree
env:
GITHUB_TOKEN: ${{ github.token }}
run: node scripts/verify-release.mjs --surfaces=npm,github-release,tags
publish-gitlab-component:
name: Publish the GitLab CI/CD component
needs: release
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Push integrations/gitlab and tag the catalog version
shell: bash
env:
GITLAB_DEPLOY_KEY: ${{ secrets.DIFFCI_GITLAB_DEPLOY_KEY }}
RELEASE_COMMIT: ${{ github.sha }}
run: |
set -euo pipefail
version=$(node -p "require('./packages/diffci-cli/package.json').version")
grep -Fq "default: \"$version\"" integrations/gitlab/templates/observe/template.yml
key="$RUNNER_TEMP/gitlab_deploy_key"
# A key pasted on Windows carries CRs, which OpenSSH rejects as an invalid key.
printf '%s\n' "$GITLAB_DEPLOY_KEY" | tr -d '\r' > "$key"
chmod 0600 "$key"
# gitlab.com's published ED25519 host key (SHA256:eUXGGm1YGsMAS7vkcx6JOJdOGHPem5gQp4taiCfCLB8).
echo "gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf" > "$RUNNER_TEMP/gitlab_known_hosts"
export GIT_SSH_COMMAND="ssh -i $key -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$RUNNER_TEMP/gitlab_known_hosts"
remote=git@gitlab.com:diffci/diffci.git
catalog="$RUNNER_TEMP/catalog"
# Tags are immutable releases in the catalog; a rerun of the same version does nothing.
if git ls-remote --exit-code --tags "$remote" "refs/tags/$version" >/dev/null; then
echo "Catalog tag $version already exists"
exit 0
fi
git clone --quiet "$remote" "$catalog"
# The catalog project holds exactly integrations/gitlab/ plus the licence, nothing else.
find "$catalog" -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
cp -R integrations/gitlab/. "$catalog/"
cp LICENSE "$catalog/LICENSE"
cd "$catalog"
git config user.name "DiffCI release"
git config user.email "release@diffci.com"
git checkout --quiet -B main
git add --all
if ! git diff --cached --quiet; then
git commit --quiet -m "DiffCI components $version" -m "From DiffCI/core@$RELEASE_COMMIT"
fi
git tag -a "$version" -m "DiffCI components $version (DiffCI/core@$RELEASE_COMMIT)"
git push --quiet origin main "refs/tags/$version"
# The tag pipeline in the catalog project creates the GitLab release that publishes the version.
echo "Pushed catalog tag $version; release: https://gitlab.com/diffci/diffci/-/releases/$version"
publish-mcp-registry:
name: Publish matching MCP Registry listing
needs: release
uses: ./.github/workflows/publish-mcp-registry.yml
permissions:
contents: read
id-token: write
# The public-release sync runs here, not in DiffCI.com (2026-11-18): that repository is private and its
# GitHub Actions cannot start jobs (billing), so the 0.3.54 sync was done by hand. This job checks it out
# and runs its scripts/sync-release.mjs, the same command a person runs when this job fails.
notify-hosted-mcp:
name: Synchronize and deploy hosted MCP
needs: publish-mcp-registry
runs-on: ubuntu-26.04
timeout-minutes: 45
# Holds CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID; restrict it to cli-release-v* tags.
environment: diffci-com-deploy
concurrency:
group: diffci-com-release-sync
cancel-in-progress: false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check out DiffCI.com at main
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: DiffCI/DiffCI.com
ref: main
path: diffci-com
fetch-depth: 0
token: ${{ secrets.DIFFCI_PRODUCT_DISPATCH_TOKEN }}
# The sync step below gets push access through its own environment, not a stored credential.
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
cache-dependency-path: diffci-com/package-lock.json
- name: Synchronize, deploy and verify the release on DiffCI.com
shell: bash
working-directory: diffci-com
env:
RELEASE_COMMIT: ${{ github.sha }}
GITHUB_TOKEN: ${{ github.token }}
PUSH_TOKEN: ${{ secrets.DIFFCI_PRODUCT_DISPATCH_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
set -euo pipefail
test -n "$CLOUDFLARE_API_TOKEN" && test -n "$CLOUDFLARE_ACCOUNT_ID" || {
echo "::error::The diffci-com-deploy environment needs CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID." >&2
exit 1
}
version=$(node -p "require('../packages/diffci-cli/package.json').version")
git config user.name "diffci-release-bot[bot]"
git config user.email "177150159+diffci-release-bot[bot]@users.noreply.github.com"
# Push access for this step only, as an HTTP header Git reads from the environment.
basic=$(printf 'x-access-token:%s' "$PUSH_TOKEN" | base64 -w0)
echo "::add-mask::$basic"
export GIT_CONFIG_COUNT=1
export GIT_CONFIG_KEY_0="http.https://github.com/.extraheader"
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic $basic"
node scripts/sync-release.mjs --version "$version" --action-sha "$RELEASE_COMMIT"