-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start work for issue #264 * config: set up kdadmin * config: add line at end * config: delete unnecessary files * config: add line at end of file
- Loading branch information
Showing
4 changed files
with
13 additions
and
50 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1 @@ | ||
Clear-Host; | ||
|
||
Write-Host -NoNewline "Please enter an issue number: " -ForegroundColor Cyan; | ||
$issueNumber = Read-Host; | ||
|
||
if ($issueNumber -notmatch '^\d+$') { | ||
Write-Error "User input is not a number"; | ||
exit 1; | ||
} | ||
|
||
Write-Host -NoNewline "Please enter a branch name: " -ForegroundColor Cyan; | ||
$branchDescrip = Read-Host; | ||
|
||
$branchDescrip = $branchDescrip.ToLower(); | ||
$branchDescrip = $branchDescrip.Replace(" ", "-").Replace("_", "-"); | ||
$branchDescrip = $branchDescrip.TrimStart("-"); | ||
$branchDescrip = $branchDescrip.TrimEnd("-"); | ||
|
||
$headBranch = "feature/$issueNumber-$branchDescrip"; | ||
$commitMsg = "Start work for issue #$issueNumber"; | ||
|
||
$destBranch = "not-set"; | ||
|
||
$baseBranches = @("main", "preview"); | ||
Write-Host -NoNewline "Please choose a base branch from the list [$($baseBranches -join ', ')]: " -ForegroundColor Cyan; | ||
$chosenBaseBranch = Read-Host; | ||
|
||
if ($baseBranches -contains $chosenBaseBranch) { | ||
$destBranch = $chosenBaseBranch; | ||
} else { | ||
Write-Error "Invalid base branch."; | ||
exit 1; | ||
} | ||
|
||
Write-Host "`n--------------------------------`n"; | ||
|
||
Write-Host "Creating branch. . ." -ForegroundColor Yellow; | ||
git checkout -B "$headBranch"; | ||
Write-Host ""; | ||
|
||
Write-Host "Creating empty commit. . ." -ForegroundColor Yellow; | ||
git commit --allow-empty -m $commitMsg; | ||
Write-Host ""; | ||
|
||
Write-Host "Pushing branch to remote. . ." -ForegroundColor Yellow; | ||
git push --set-upstream origin "$headBranch"; | ||
Write-Host ""; | ||
|
||
Write-Host "Creating PR. . ." -ForegroundColor Yellow; | ||
gh pr create -B $destBranch -b "" -t "new pr" -d; | ||
& "dev-tools/bin/kd-admin" create-pr; |
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,3 @@ | ||
#!/bin/sh | ||
# generated by deno install | ||
deno "run" "--allow-read" "--allow-write" "--allow-net" "--allow-env" "--allow-run" "--no-config" "https://raw.githubusercontent.com/KinsonDigital/kd-admin/v1.0.0-preview.3/src/main.ts" "$@" |
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,2 @@ | ||
% generated by deno install % | ||
@deno "run" "--allow-read" "--allow-write" "--allow-net" "--allow-env" "--allow-run" "--no-config" "https://raw.githubusercontent.com/KinsonDigital/kd-admin/v1.0.0-preview.3/src/main.ts" %* |
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,7 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/KinsonDigital/kd-admin/preview/schemas/create-pr-schema.json", | ||
"ownerName": "KinsonDigital", | ||
"repoName": "VelaptorDocs", | ||
"githubTokenEnvVarName": "CICD_TOKEN", | ||
"baseBranches": [ "main", "preview"] | ||
} |