diff --git a/.gitea/workflows/Create the Corresponding Branch of the New Odoo Ticket.yaml b/.gitea/workflows/Create the Corresponding Branch of the New Odoo Ticket.yaml index 4ce2397..eb335bb 100644 --- a/.gitea/workflows/Create the Corresponding Branch of the New Odoo Ticket.yaml +++ b/.gitea/workflows/Create the Corresponding Branch of the New Odoo Ticket.yaml @@ -2,7 +2,9 @@ name: Create a new branch and link it back to the issue. on: issues: - types: [opened] + types: + - opened + - reopened jobs: create-branch: diff --git a/main.go b/main.go index 45f9509..36b1653 100644 --- a/main.go +++ b/main.go @@ -115,8 +115,12 @@ 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" + if prefix == "hotfix" { + originBranch = "origin/main" + } + 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)