1 Commits

Author SHA1 Message Date
96007dc289 chore(deps): update actions/checkout action to v5
Some checks failed
Golang Tests / unittest (stable, ubuntu-latest-amd64) (push) Failing after 3s
Golang Tests / unittest (stable, ubuntu-latest-amd64) (pull_request) Failing after 2s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (pull_request) Failing after 2s
Lint Markdown files / markdown-lint (pull_request) Failing after 2s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (push) Failing after 8s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (push) Failing after 3s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (push) Failing after 4s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (pull_request) Failing after 3s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (pull_request) Failing after 3s
2025-08-11 16:06:25 +00:00
10 changed files with 33 additions and 70 deletions

View File

@@ -1,4 +1,4 @@
name: "Run Golang tests"
name: Golang Tests
on:
pull_request:
@@ -6,27 +6,9 @@ on:
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
workflow_dispatch: {}
jobs:
# integration-test:
# name: "Run integration tests"
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# go: [ stable ]
# os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
# steps:
# - uses: actions/checkout@v4.3.0
# - uses: actions/setup-go@v5.5.0
# with:
# go-version: ${{ matrix.go }}
# - env:
# GOPROXY: ${{ vars.GOPROXY }}
# run: make test/integration
unit-test:
name: "Run unit tests"
unittest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
@@ -34,7 +16,7 @@ jobs:
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps:
- uses: actions/checkout@v5.0.0
- uses: actions/setup-go@v6.0.0
- uses: actions/setup-go@v5.5.0
with:
go-version: ${{ matrix.go }}
- env:

View File

@@ -1,4 +1,4 @@
name: "Lint Golang files"
name: Golang CI lint
on:
pull_request:
@@ -6,14 +6,12 @@ on:
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
workflow_dispatch: {}
permissions:
contents: read
jobs:
golangci:
name: "Run golang CI linter"
runs-on: ${{ matrix.os }}
strategy:
matrix:
@@ -21,9 +19,9 @@ jobs:
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps:
- uses: actions/checkout@v5.0.0
- uses: actions/setup-go@v6.0.0
- uses: actions/setup-go@v5.5.0
with:
go-version: ${{ matrix.go }}
- uses: golangci/golangci-lint-action@v8.0.0
with:
version: v2.5.0 # renovate: datasource=github-releases depName=golangci/golangci-lint
version: v2.1

View File

@@ -1,4 +1,4 @@
name: "Lint Markdown files"
name: 'Lint Markdown files'
on:
pull_request:
@@ -6,12 +6,11 @@ on:
push:
branches: [ '*' ]
tags-ignore: [ '*' ]
workflow_dispatch: {}
jobs:
markdown-lint:
name: "Run markdown linter"
runs-on: ubuntu-latest
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v5.0.0
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0

View File

@@ -1,4 +1,4 @@
name: "Release"
name: Release
on:
push:
@@ -9,15 +9,15 @@ permissions:
jobs:
release:
name: "Release application"
runs-on: ubuntu-latest
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v5.0.0
- uses: docker/setup-qemu-action@v3.6.0
- uses: actions/setup-go@v6.0.0
- uses: actions/setup-go@v5.5.0
with:
go-version: stable
- uses: docker/login-action@v3.6.0
- uses: docker/login-action@v3.5.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
@@ -26,13 +26,12 @@ jobs:
GITEA_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
GONOSUMDB: ${{ vars.GONOSUMDB }}
GOPROXY: ${{ vars.GOPROXY }}
uses: goreleaser/goreleaser-action@v6.4.0
uses: goreleaser/goreleaser-action@v6.3.0
with:
version: v2.12.5 # renovate: datasource=github-releases depName=goreleaser/goreleaser
version: "~> v2"
args: release --clean
sync-to-hub-docker-io:
name: "Upload Images to docker.io"
needs:
- release
runs-on: ubuntu-latest

View File

@@ -1,4 +1,4 @@
name: "Update Docker Hub Description"
name: Update Docker Hub Description
on:
push:
@@ -8,10 +8,11 @@ on:
jobs:
update-description-on-hub-docker-io:
runs-on: ubuntu-latest
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v5.0.0
- uses: peter-evans/dockerhub-description@v5.0.0
- uses: peter-evans/dockerhub-description@v4.0.2
with:
username: ${{ secrets.DOCKER_IO_USERNAME }}
password: ${{ secrets.DOCKER_IO_PASSWORD }}

View File

@@ -1,13 +0,0 @@
version: "2"
linters:
default: standard
enable:
- errname
- gosec
exclusions:
rules: []
warn-unused: true
run:
tests: true

View File

@@ -90,13 +90,11 @@ func run(cmd *cobra.Command, args []string) error {
switch {
case len(outputFile) > 0:
// #nosec G301
err = os.MkdirAll(filepath.Dir(outputFile), 0755)
if err != nil {
return err
}
// #nosec G304
f, err := os.Create(outputFile)
if err != nil {
return err

6
go.mod
View File

@@ -3,8 +3,8 @@ module git.cryptic.systems/volker.raschek/dcmerge
go 1.20
require (
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
github.com/spf13/cobra v1.9.1
github.com/stretchr/testify v1.10.0
gopkg.in/yaml.v3 v3.0.1
)
@@ -12,5 +12,5 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.9 // indirect
github.com/spf13/pflag v1.0.6 // indirect
)

12
go.sum
View File

@@ -6,12 +6,12 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

View File

@@ -43,7 +43,7 @@ func Fetch(urls ...string) ([]*dockerCompose.Config, error) {
return dockerComposeConfigs, nil
}
var ErrPathIsDir error = errors.New("path is a directory")
var ErrorPathIsDir error = errors.New("path is a directory")
func getDockerComposeViaHTTP(url string) (*dockerCompose.Config, error) {
req, err := http.NewRequest(http.MethodGet, url, nil)
@@ -78,10 +78,9 @@ func readDockerComposeFromFile(name string) (*dockerCompose.Config, error) {
case err != nil:
return nil, err
case fileStat.IsDir():
return nil, fmt.Errorf("%w: %s", ErrPathIsDir, name)
return nil, fmt.Errorf("%w: %s", ErrorPathIsDir, name)
}
// #nosec G304
file, err := os.Open(name)
if err != nil {
return nil, err