diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/Dockerfile b/Dockerfile index 4db8a52..b29fbb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /app COPY go.mod go.sum /app/ RUN go mod download -COPY *.go /app/ +COPY . /app/ RUN go build -o app . FROM docker.io/alpine:3.22 diff --git a/go.mod b/go.mod index 83158b7..4825266 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module code.geekeey.de/actions/checkout go 1.23.2 -require code.geekeey.de/actions/sdk v1.2.0 +require code.geekeey.de/actions/sdk v1.5.0 diff --git a/go.sum b/go.sum index 6a21fc7..b25cf65 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -code.geekeey.de/actions/sdk v1.2.0 h1:qQvOdTBtZVpR1xATNnApeiW78y34Jh83OjsQg1ajPjA= -code.geekeey.de/actions/sdk v1.2.0/go.mod h1:7iIOi3YUmdDe2BCz9s59wK1t0Ckec34e664q+TOreiE= +code.geekeey.de/actions/sdk v1.5.0 h1:7Ly8QsBniiwDVbv2Gm14l28+ccK1Z9fVUqsPHw9lSMg= +code.geekeey.de/actions/sdk v1.5.0/go.mod h1:7iIOi3YUmdDe2BCz9s59wK1t0Ckec34e664q+TOreiE= diff --git a/main.go b/main.go index 9fff017..f410c1f 100644 --- a/main.go +++ b/main.go @@ -32,8 +32,6 @@ type CheckoutAction struct { } func (action *CheckoutAction) setup() error { - var err error - action.repository = action.GetInput("repository") if len(action.repository) == 0 { return fmt.Errorf("input 'repository': is empty") // something like '//.git' @@ -48,7 +46,8 @@ func (action *CheckoutAction) setup() error { if len(action.reference) == 0 { return fmt.Errorf("input 'ref': is empty") // something like 'HEAD' } - return err + + return nil } func (action *CheckoutAction) Run(ctx context.Context) error {