Files
mattermost/.github/workflows/docs-preview-fork.yml
T
Eva Sarafianou 8828e5a258 fix(docs-preview): set commit status via gh api for correct target_url (#37664)
* docs: mark scale partial pages as unlisted with proper titles

These MDX files are content partials imported into the scale-to-*-users
pages, mirroring the :orphan:/:nosearch: Sphinx pages they were migrated
from. Without frontmatter, Docusaurus rendered them as full standalone
pages with an ugly slug-derived title, breadcrumbs, and pagination.
unlisted: true keeps their routes alive (needed by the PDF book builder
and legacy redirects) while hiding them from the sidebar, breadcrumbs,
pagination, and search indexing.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(docs-preview): set commit status via gh api for correct target_url

The shared mattermost/actions/delivery/update-commit-status action accepts
a target_url input but ignores it, hardcoding the Actions run URL instead.
This made the docs-preview PR check's Details link point at the workflow
run rather than the S3-hosted preview site.

Switch docs-preview-template.yml and docs-preview-fork.yml to call the
GitHub Statuses API directly via `gh api repos/.../statuses/{sha}`, matching
the pattern in e2e-tests-playwright.yml, so the success status's target_url
points at the actual preview URL.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 10:28:39 +03:00

48 lines
1.4 KiB
YAML

name: docs-preview-fork
on:
workflow_dispatch:
inputs:
PR_NUMBER:
type: string
required: true
description: "PR number (fork PR to build preview for)"
COMMIT_SHA:
type: string
required: true
description: "Full commit SHA to build"
permissions:
contents: read
statuses: write
jobs:
update-initial-status:
runs-on: ubuntu-latest
steps:
- name: Set pending commit status
env:
COMMIT_SHA: ${{ inputs.COMMIT_SHA }}
CONTEXT_NAME: docs-preview
GH_TOKEN: ${{ github.token }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
gh api "repos/${GITHUB_REPOSITORY}/statuses/${COMMIT_SHA}" \
-f state=pending \
-f context="${CONTEXT_NAME}" \
-f description="Docs preview build for ${COMMIT_SHA} is running" \
-f target_url="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
deploy:
uses: ./.github/workflows/docs-preview-template.yml
secrets:
AWS_DOCS_PR_PREVIEW_KEY_ID: ${{ secrets.AWS_DOCS_PR_PREVIEW_KEY_ID }}
AWS_DOCS_PR_PREVIEW_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCS_PR_PREVIEW_SECRET_ACCESS_KEY }}
needs:
- update-initial-status
with:
PR_NUMBER: ${{ inputs.PR_NUMBER }}
COMMIT_SHA: ${{ inputs.COMMIT_SHA }}
STATUS_CONTEXT: docs-preview