Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/deploy-cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
type: choice
options: [site, harness-proof]
default: site
rotate_registry_github_token:
description: Rotate the registry GitHub fallback token
type: boolean
default: false

permissions:
contents: read
Expand Down Expand Up @@ -94,6 +98,24 @@ jobs:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- name: Rotate registry GitHub fallback token
if: github.event_name == 'workflow_dispatch' && inputs.rotate_registry_github_token
run: |
if [ -z "$REGISTRY_GITHUB_TOKEN" ]; then
echo 'If the replacement token is missing, set REGISTRY_GITHUB_TOKEN.' >&2
exit 1
fi
curl --fail --silent --show-error \
-H "Authorization: Bearer $REGISTRY_GITHUB_TOKEN" \
-H 'Accept: application/vnd.github+json' \
https://api.github.com/user \
--output "$RUNNER_TEMP/registry-token-owner.json"
printf '%s' "$REGISTRY_GITHUB_TOKEN" | pnpm exec wrangler secret put GITHUB_TOKEN --config wrangler.jsonc
env:
REGISTRY_GITHUB_TOKEN: ${{ secrets.REGISTRY_GITHUB_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

# Retries a transient Cloudflare API fault, such as code 10013. Any other
# failure stops the job at once.
- name: Deploy Artifact signer
Expand Down
Loading