From 5968511f77b73823812833bcbfaf30dd20e232d5 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 04:16:29 +0000 Subject: [PATCH] Remove the one-time move-secrets workflow The deploy secrets are in the production environment, so the workflow has nothing left to do. --- .../workflows/move-secrets-to-production.yml | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 .github/workflows/move-secrets-to-production.yml diff --git a/.github/workflows/move-secrets-to-production.yml b/.github/workflows/move-secrets-to-production.yml deleted file mode 100644 index 81063a4..0000000 --- a/.github/workflows/move-secrets-to-production.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Move Secrets to Production - -# One-time job: copies the deploy secrets from repository level into the `production` -# environment without anyone needing to know their values. Remove this file once the -# repository-level copies are deleted. Steps are in the pull request that added it. -# -# Requires SECRETS_MOVE_TOKEN in the `production` environment: a fine-grained personal -# access token for this repository only, with Environments read and write, and a one-day -# expiry. GITHUB_TOKEN cannot write secrets. -# -# No checkout and no third-party actions: nothing but this file runs next to the values. - -on: - workflow_dispatch: - -permissions: {} - -concurrency: - group: move-secrets-to-production - cancel-in-progress: false - -jobs: - copy: - name: Copy repository secrets to production - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - environment: production - timeout-minutes: 5 - steps: - - name: Copy secrets - env: - GH_TOKEN: ${{ secrets.SECRETS_MOVE_TOKEN }} - GH_REPO: ${{ github.repository }} - CLOUDFLARE_ROLE_MANAGEMENT_TOKEN: ${{ secrets.CLOUDFLARE_ROLE_MANAGEMENT_TOKEN }} - DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }} - DISCORD_GUILD_ID: ${{ secrets.DISCORD_GUILD_ID }} - GCP_PROD_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_PROD_SERVICE_ACCOUNT_KEY }} - ORG_BILLING_EMAIL: ${{ secrets.ORG_BILLING_EMAIL }} - PULUMI_PROD_PASSPHRASE: ${{ secrets.PULUMI_PROD_PASSPHRASE }} - run: | - set -euo pipefail - names=( - CLOUDFLARE_ROLE_MANAGEMENT_TOKEN - DISCORD_BOT_TOKEN - DISCORD_GUILD_ID - GCP_PROD_SERVICE_ACCOUNT_KEY - ORG_BILLING_EMAIL - PULUMI_PROD_PASSPHRASE - ) - - # Check everything before writing anything, so a failed check changes nothing - if [ -z "$GH_TOKEN" ]; then - echo "::error::SECRETS_MOVE_TOKEN is not set in the production environment; nothing was copied" - exit 1 - fi - # A secret already in production hides the repository-level one, so copying it - # would prove nothing. Delete it from production first, then run this again. - stored=$(gh secret list --env production --json name --jq '.[].name') - for name in "${names[@]}"; do - if grep -qxF "$name" <<<"$stored"; then - echo "::error::$name is already in the production environment; nothing was copied" - exit 1 - fi - done - for name in "${names[@]}"; do - if [ -z "${!name}" ]; then - echo "::error::$name is empty; nothing was copied" - exit 1 - fi - done - - # Values go through stdin, never the command line - for name in "${names[@]}"; do - printf '%s' "${!name}" | gh secret set "$name" --env production - done - - # Confirm production now holds every secret under its own name - stored=$(gh secret list --env production --json name --jq '.[].name') - for name in "${names[@]}"; do - if ! grep -qxF "$name" <<<"$stored"; then - echo "::error::$name is not in the production environment" - exit 1 - fi - done - echo "All ${#names[@]} secrets are in the production environment."