Skip to content

ci: scope Netlify secrets to netlify-preview environment#13614

Merged
ilhan007 merged 1 commit into
mainfrom
ci-netlify-secrets
May 29, 2026
Merged

ci: scope Netlify secrets to netlify-preview environment#13614
ilhan007 merged 1 commit into
mainfrom
ci-netlify-secrets

Conversation

@ilhan007
Copy link
Copy Markdown
Collaborator

What

Move NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID out of repository-level secrets and into a dedicated GitHub Environment named netlify-preview. The two preview-deploy workflows now declare environment: netlify-preview, so they can only see those secrets when the environment's branch / reviewer protections allow.

Why

Repository-level secrets are exposed to every workflow run on every branch. Scoping deploy/publish secrets to GitHub Environments is part of the security hardening for this repo (companion to the existing npmjs:@ui5/webcomponents environment used by release.yaml).

Files changed

  • .github/workflows/deploy-preview.yamldeploy-preview job now uses environment: netlify-preview
  • .github/workflows/reset-preview-deploy.yamlcleanup-preview job now uses environment: netlify-preview

Required action before merge

The netlify-preview environment must exist in Settings → Environments with:

  • Secret: NETLIFY_AUTH_TOKEN
  • Secret: NETLIFY_SITE_ID
  • Protection rules as desired (no required reviewers, otherwise PR previews block forever)

After this merges and the next preview deploy succeeds, the repository-level copies of NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID should be deleted.

Out of scope

UI5_WEBCOMP_BOT_GH_TOKEN is intentionally left at the repository level for now — it is consumed by several non-deploy workflows (issue automation, etc.) and migrating it is a separate refactor.

Move NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID out of repository-level
secrets and into a dedicated GitHub Environment (netlify-preview), so
the secrets are only available to the workflows that actually deploy
PR previews — and only when the configured branch / reviewer
protections allow.

The matching environment must exist in repo Settings → Environments
with the two secrets defined before this change is merged.
@ilhan007 ilhan007 merged commit b0a1cf4 into main May 29, 2026
10 of 11 checks passed
@ilhan007 ilhan007 deleted the ci-netlify-secrets branch May 29, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant