Conversation
Point preview.yml at a new `preview` environment and document that all deploy credentials live as environment secrets in `production` (main-only) and `preview` (required reviewers), with nothing at repository level. Repository secrets resolve for any workflow on any branch, so write access alone was enough to read the org-owner token by pushing a workflow file.
Pulumi PreviewClick to expand preview output |
Contributor
Author
|
Closing: moving to environment secrets means re-entering every value, which we don't want to do right now. Keeping write access on this repo narrow instead. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deploy credentials for this repo (the org-owner GitHub token, the GCP state key, the Pulumi passphrase, the Discord bot token, the Cloudflare token) are currently repository-level Actions secrets. Those resolve for any workflow on any branch, so anyone with write access can read them by pushing a workflow file to a branch. With
maintainersnow holding write here, that is a much wider set of people than the deploy path was designed for.This moves the model to environment secrets only.
productionkeeps servingdeploy.ymland gets amain-only deployment-branch policy. A newpreviewenvironment servespreview.ymlon PR branches and is gated by required reviewers (core-maintainers, self-review allowed), so a preview run waits for one click under Review deployments and a tampered workflow never reaches the secrets unreviewed. The README's secrets section now lists every secret the workflows read (it previously omittedPULUMI_GITHUB_TOKEN, the Discord pair, andORG_BILLING_EMAIL) and describes the two environments.NPM_READ_TOKENstays at repository level; it is read-only.Safe to merge first: jobs that declare an environment still see repository-level secrets, so nothing changes until the last step below removes them. GitHub already auto-created an empty
previewenvironment from this PR's own run; configure it rather than creating a new one.Admin steps after merging, in order
preview: add required reviewerscore-maintainers(leave "prevent self-review" off); add all seven secrets (GCP_PROD_SERVICE_ACCOUNT_KEY,PULUMI_PROD_PASSPHRASE,PULUMI_GITHUB_TOKEN,DISCORD_BOT_TOKEN,DISCORD_GUILD_ID,ORG_BILLING_EMAIL,CLOUDFLARE_ROLE_MANAGEMENT_TOKEN).production: set deployment branches tomainonly; add the same seven secrets. (Do this after merge: whilepreview.ymlonmainstill points atproduction, amain-only policy would block previews on open PRs.)mainand the next approved preview both succeed.Test plan
npm run format:checkclean; YAML parses withenvironment: preview. Functional check is step 3.