Skip to content

chore: added deploy and redeploy documentation preview workflows (#DS-4784)#1769

Draft
artembelik wants to merge 2 commits into
19.xfrom
chore/DS-4784-v19
Draft

chore: added deploy and redeploy documentation preview workflows (#DS-4784)#1769
artembelik wants to merge 2 commits into
19.xfrom
chore/DS-4784-v19

Conversation

@artembelik

Copy link
Copy Markdown
Contributor

@artembelik artembelik self-assigned this Jul 22, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 11:36
@artembelik
artembelik requested a review from lskramarov as a code owner July 22, 2026 11:36
@artembelik artembelik added 19.x github_actions Pull requests that update GitHub Actions code labels Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the documentation preview CI by replacing the old PR-triggered Firebase deploy workflow with separate build and deploy workflows, and by introducing a comment-triggered “redeploy preview” workflow. It also tightens access to comment-triggered workflows by restricting who can trigger them based on author_association.

Changes:

  • Added deploy-preview.yml to deploy Firebase Hosting previews for eligible in-repo PRs.
  • Added redeploy-preview.yml to redeploy previews via PR comment command (/redeploy-preview).
  • Updated e2e-approve-snapshots.yml to restrict /approve-snapshots triggering to OWNER/MEMBER, and removed the legacy pr-docs-preview.yml workflow in favor of the new split workflow setup.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/redeploy-preview.yml New comment-triggered workflow to rebuild and redeploy documentation preview channels.
.github/workflows/pr-docs-preview.yml Removed the previous PR-based hosting deploy workflow.
.github/workflows/e2e-approve-snapshots.yml Restricted snapshot-approval command execution and clarified permissions intent.
.github/workflows/deploy-preview.yml New PR-based workflow to deploy documentation previews for in-repo PRs.
.github/workflows/build.yml New PR-based workflow to build packages/docs independently of deploy eligibility.
Comments suppressed due to low confidence (1)

.github/workflows/e2e-approve-snapshots.yml:22

  • This workflow runs PR-controlled code with contents: write, but it only checks the commenter’s author_association. On forked PRs, head_ref may not exist in this repo (or may collide with an existing branch like main), and the job could end up running on/pushing to the wrong branch with a write token. Also, using contains() can trigger on any mention of the command (quotes/code blocks); prefer startsWith() to reduce accidental execution.
    if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/approve-snapshots') && contains(fromJSON('["OWNER", "MEMBER"]'), github.event.comment.author_association) }}
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +30
redeploy:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/redeploy-preview') && contains(fromJSON('["OWNER", "MEMBER"]'), github.event.comment.author_association) }}
runs-on: ubuntu-latest
steps:
- uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
id: comment-branch
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
with:
message: 🔄 [Redeploying](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) documentation preview.
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- uses: ./.github/workflows/actions/setup-node
Comment on lines +9 to +16
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ./.github/workflows/actions/setup-node
- uses: ./.github/workflows/actions/build-packages
- uses: ./.github/workflows/actions/build-docs
@artembelik
artembelik marked this pull request as draft July 22, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

19.x github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants