-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5c0566
commit 01a43b2
Showing
2 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { env } from "process"; | ||
|
||
export const preview = env.CI_ENV === "preview"; | ||
|
||
export const deploymentID: string = | ||
`${env.GITHUB_PR_HEAD_OWNER}-${env.GITHUB_HEAD_REF || env.GITHUB_REF_NAME}` // <PR head branch owner username>-<head branch name> | ||
.substring(0, 28) // capped to 28 characters | ||
.toLowerCase() // lowercase | ||
.replaceAll(/[/_.]/g, "-"); // sanitize characters in branch names |