8000 restore the original environment name logic · numtide/github-deploy@2470bc3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2470bc3

Browse files
committed
restore the original environment name logic
1 parent 5111335 commit 2470bc3

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

command/please.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package command
33
import (
44
"context"
55
"errors"
6+
"fmt"
67
"log"
78
"os"
89
"os/exec"
@@ -53,15 +54,9 @@ func CmdPlease(c *cli.Context) (err error) {
5354
}
5455
}
5556

56-
// If the environment is not set, set as follows:
57-
// * branch is master: production
58-
// * otherwise: pr-preview
59-
if environment == "" {
60-
if branch == "master" {
61-
environment = "production"
62-
} else {
63-
environment = "pr-preview"
64-
}
57+
// Override the deployment target on pull-request
58+
if pr > 0 {
59+
environment = fmt.Sprintf("pr-%d", pr)
6560
}
6661

6762
ctx := context.Background()

0 commit comments

Comments
 (0)
0