Compare commits
7 Commits
v1.0.1-bet
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbdab7caaa | ||
|
|
b02b68c668 | ||
|
|
e202c32a31 | ||
|
|
c43a4473ee | ||
|
|
1b936d8431 | ||
|
|
c4cf4aa33e | ||
|
|
bdfc0beb23 |
@ -0,0 +1,20 @@
|
||||
name: Create a new branch and link it back to the issue.
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
create-branch:
|
||||
runs-on: node1-runner-timesheet1
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
clean: 'true'
|
||||
ref: 'main'
|
||||
|
||||
- name: Create a New Branch and Link to Issue
|
||||
uses: https://gitea.ethumada.com/gitea/new-issue-branch@develop
|
||||
13
main.go
13
main.go
@ -115,8 +115,17 @@ func main() {
|
||||
logger.Printf("Branch '%s' already exists. No action taken.\n", branchName)
|
||||
} else {
|
||||
// Create and push the branch
|
||||
logger.Printf("Creating branch '%s' from 'develop'.\n", branchName)
|
||||
err = runCommand(logger, "git", "checkout", "-b", branchName, "origin/develop")
|
||||
originBranch := "origin/develop"
|
||||
|
||||
logger.Printf("Prefix is : %s", prefix)
|
||||
if prefix == "hotfix" {
|
||||
originBranch = "origin/main"
|
||||
} else {
|
||||
logger.Printf("hotfix != %s", prefix)
|
||||
}
|
||||
|
||||
logger.Printf("Creating branch '%s' from '%s'.\n", branchName, originBranch)
|
||||
err = runCommand(logger, "git", "checkout", "-b", branchName, originBranch)
|
||||
if err != nil {
|
||||
logger.Printf("Error while creating the branch: %v\n", err)
|
||||
os.Exit(1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user