Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docs preview create

Docs preview create #13065

name:Docs preview create
on:
workflow_dispatch:
inputs:
repo:
description:'Repository name (not fully-qualified, eg. `svelte` or `kit`)'
required:true
type:string
pr:
description:'PR number'
required:true
type:string
owner:
description:'Owner (eg. sveltejs)'
required:true
type:string
branch:
description:'Branch (eg. my-feature-branch)'
required:true
type:string
sha:
description:'The commit SHA responsible for triggering this workflow'
required:false
type:string
permissions:
contents:write
env:
BRANCH:preview-${{ inputs.repo }}-${{ inputs.pr }}
jobs:
Sync:
name:Sync
runs-on:ubuntu-latest
concurrency:
group:preview-${{ inputs.repo }}-${{ inputs.pr }}# can't reference env here
cancel-in-progress:true
steps:
-uses:actions/checkout@v4
with:
token:${{ secrets.GH_TOKEN }}
ref:main# Explicitly checkout main branch first
-uses:pnpm/action-setup@v4
-uses:actions/setup-node@v4
with:
node-version:22
cache:pnpm
-run:pnpm install --frozen-lockfile
-name:Create or reset branch from main
run:|
git fetch origin
git checkout -B ${{ env.BRANCH }} # Force create/reset branch based on current main
-name:Sync
run:cd apps/svelte.dev && pnpm sync-docs --owner="${{ inputs.owner }}" -p "${{ inputs.repo }}#${{ inputs.branch }}"
-name:Configure Git
run:|
git config --global user.name "GitHub Actions Bot"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
-name:Push
id:push
continue-on-error:true
run:git add -A && git commit -m "sync docs for repo ${{ inputs.repo }}, pr ${{ inputs.pr }}, commit ${{ inputs.sha }}" && git push -u origin ${{ env.BRANCH }} --force
-name:Request preview comment
if:${{ steps.push.outcome == 'success' }}
uses:peter-evans/repository-dispatch@v3
with:
event-type:'request-preview-comment'
client-payload:|-
{
"repo": "${{ inputs.repo }}",
"pr": "${{ inputs.pr }}"
}
-name:Dispatch docs-unaffected
if:${{ steps.push.outcome != 'success' }}
uses:peter-evans/repository-dispatch@v3
with:
event-type:'docs-unaffected'
client-payload:|-
{
"repo": "${{ inputs.repo }}",
"pr": "${{ inputs.pr }}",
"sha": "${{ inputs.sha }}"
}

[8]ページ先頭

©2009-2025 Movatter.jp