Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New "safe" preview deployment workflows #406

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Feb 3, 2025

Context

The current preview deployment workflow required pull_request_target to be able to deploy PRs from forks.

Using pull_request_target in conjunction with checking out the fork is considered a security risk.

Changes

This introduces a workflow setup that requires three workflows.

  1. A workflow that builds the docs using the pull_request event and uploads it as artifacts
  2. A workflow that downloads the artifacts and deploys the docs to the preview environment using the workflow_run event
  3. A workflow that destroys the destroys the preview environment using the pull_request_target event (but without a checkout step)

This way untrusted code will never be checked out.

@reakaleek reakaleek force-pushed the feature/new-preview-deploy branch from ee9141a to 5d7b82d Compare February 3, 2025 22:57
@reakaleek reakaleek force-pushed the feature/new-preview-deploy branch from 5d7b82d to e15bd30 Compare February 3, 2025 23:03
@reakaleek reakaleek marked this pull request as ready for review February 3, 2025 23:03
@reakaleek reakaleek requested a review from a team February 3, 2025 23:04
@reakaleek reakaleek self-assigned this Feb 3, 2025
@reakaleek reakaleek changed the title New preview deployment workflows New "safe" preview deployment workflows Feb 3, 2025
Copy link
Member

@bmorelli25 bmorelli25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@reakaleek reakaleek enabled auto-merge (squash) February 3, 2025 23:21
@reakaleek reakaleek disabled auto-merge February 3, 2025 23:22
@reakaleek reakaleek merged commit 9322e16 into main Feb 3, 2025
5 checks passed
@reakaleek reakaleek deleted the feature/new-preview-deploy branch February 3, 2025 23:22
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.

2 participants