ci: split preview-docs workflow to support fork contributor PRs#6433
Draft
Rajdeepc wants to merge 1 commit into
Draft
ci: split preview-docs workflow to support fork contributor PRs#6433Rajdeepc wants to merge 1 commit into
Rajdeepc wants to merge 1 commit into
Conversation
The original preview-docs.yml used a pull_request trigger which causes Azure credentials (secrets) to be empty for fork PRs, breaking the azcopy login for all external contributors. Split into two workflows: - preview-docs-build.yml: runs on pull_request with no secrets; builds all assets and uploads them as a GitHub artifact including pr_number.txt (needed because workflow_run does not populate pull_requests[] for forks) - preview-docs-deploy.yml: triggered by workflow_run (base repo context, secrets available); downloads the artifact and uploads to Azure. Cleanup on PR close uses pull_request_target (also base repo context). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Collaborator
Coverage Report for CI Build 27932302661Coverage remained the same at 96.246%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
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.
Description
The original preview-docs.yml used a pull_request trigger which causes Azure credentials (secrets) to be empty for fork PRs, breaking the azcopy login for all external contributors.
Split into two workflows:
The PR number is written to a file inside the artifact by the build job. This is necessary because workflow_run does not populate pull_requests[] for fork PRs, so the deploy job reads it back from that file to post the preview comment on the correct PR.
Motivation and context
Fork contributor PRs have been failing at the azcopy login step because AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID all resolve to empty strings when a workflow is triggered by a fork pull_request event. GitHub intentionally sandboxes secrets from fork-triggered workflows as a security measure. This was reported in #6420 .
Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Descriptive Test Statement
Device review
Accessibility testing checklist
N/A — CI workflow change only, no UI or component changes.