fix: keep PR walkthrough links canonical (#3438)

This commit is contained in:
Carlos Florêncio
2026-09-06 15:14:28 +01:00
committed by GitHub
parent 7cb5d8c0b3
commit 039142db80
22 changed files with 1793 additions and 106 deletions
+5 -1
View File
@@ -18,6 +18,7 @@ func runDeploy(ctx context.Context, args []string) int {
repo := fs.String("repo", envOr("GITHUB_REPOSITORY", ""), "owner/repo")
port := fs.Int("port", ports.Backend, "kandev backend port exposed by the sprite")
skipWebInstall := fs.Bool("skip-web-install", false, "skip pnpm install (CI already ran it)")
skipDescription := fs.Bool("skip-description", false, "skip the PR description update")
if err := fs.Parse(args); err != nil {
fmt.Fprintf(os.Stderr, "preview deploy: %v\n", err)
@@ -38,7 +39,7 @@ func runDeploy(ctx context.Context, args []string) int {
return 2
}
ghToken := os.Getenv("GH_TOKEN")
if ghToken == "" {
if ghToken == "" && !*skipDescription {
fmt.Fprintln(os.Stderr, "preview deploy: GH_TOKEN is required")
return 2
}
@@ -62,6 +63,9 @@ func runDeploy(ctx context.Context, args []string) int {
}
fmt.Printf("preview URL: %s\n", previewURL)
if *skipDescription {
return 0
}
section := buildDeploySection(previewURL, *sha)
if err := upsertDescriptionSection(ctx, ghToken, *repo, *pr, section); err != nil {