Skip to content

preview-build: separate build, deploy, and link index into distinct jobs#2890

Draft
reakaleek wants to merge 3 commits intomainfrom
fix/preview-build-security
Draft

preview-build: separate build, deploy, and link index into distinct jobs#2890
reakaleek wants to merge 3 commits intomainfrom
fix/preview-build-security

Conversation

@reakaleek
Copy link
Member

What

  • Split the monolithic build job into three separate jobs: build, deploy, and update-link-index, each with minimal permissions
  • Add a vale-report job to isolate pull-requests: write from the build and vale lint jobs
  • Remove the unused free-disk-space input

Why

  • The build job currently requires deployments: write and id-token: write even for fork PRs that cannot deploy, which grants unnecessary privileges
  • Separating concerns lets fork PRs run builds without elevated permissions, and limits blast radius if any single job is compromised
  • Artifact-based handoff between jobs makes the data flow explicit and auditable

Notes

  • Build output is passed between jobs via actions/upload-artifact / actions/download-artifact
  • Fork PRs now get a warning message instead of silently skipping deployment
  • The deploy job only runs when the build succeeds and the PR is from the same repository

Made with Cursor

Split the monolithic build job into build, deploy, and update-link-index
jobs with minimal permissions per job. Move deployment creation and S3
upload out of the build job so fork PRs can still run builds without
needing write permissions. Add artifact upload/download to pass build
output between jobs. Remove unused free-disk-space input. Split vale
reporting into its own job with scoped pull-requests:write permission.

Made-with: Cursor
@github-actions
Copy link

🔍 Preview links for changed docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants