Compare commits
No commits in common. "main" and "v1.0.1-beta1" have entirely different histories.
main
...
v1.0.1-bet
@ -1,20 +0,0 @@
|
|||||||
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
|
|
||||||
10
Dockerfile
10
Dockerfile
@ -8,11 +8,15 @@ RUN apk add --no-cache git ca-certificates
|
|||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Bring in the source (vendor dir included)
|
# Copy *both* dependency files first so Docker-layer caching works
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
# Bring in the rest of the source
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build static binary using vendored dependencies
|
# Build static binary
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -o /out/action ./main.go
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/action ./main.go
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# — Runtime stage —
|
# — Runtime stage —
|
||||||
|
|||||||
14
main.go
14
main.go
@ -7,6 +7,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -115,17 +116,8 @@ func main() {
|
|||||||
logger.Printf("Branch '%s' already exists. No action taken.\n", branchName)
|
logger.Printf("Branch '%s' already exists. No action taken.\n", branchName)
|
||||||
} else {
|
} else {
|
||||||
// Create and push the branch
|
// Create and push the branch
|
||||||
originBranch := "origin/develop"
|
logger.Printf("Creating branch '%s' from 'develop'.\n", branchName)
|
||||||
|
err = runCommand(logger, "git", "checkout", "-b", branchName, "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 {
|
if err != nil {
|
||||||
logger.Printf("Error while creating the branch: %v\n", err)
|
logger.Printf("Error while creating the branch: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user