diff --git a/.github/workflows/build-docker.yaml b/.github/workflows/build-docker.yaml index 36dbeb9..4bb6894 100644 --- a/.github/workflows/build-docker.yaml +++ b/.github/workflows/build-docker.yaml @@ -11,18 +11,21 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set Swap Space uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c with: swap-size-gb: 12 - + - name: Setup Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: '1.24' + cache: false - name: Run Golangci lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: version: latest - args: --print-resources-usage build: name: "build ${{ matrix.Dockerfile }}:${{ matrix.target }}" @@ -49,7 +52,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set Swap Space uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c @@ -58,7 +61,7 @@ jobs: - name: Docker meta id: docker_meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 with: images: ${{ github.repository }},quay.io/${{ github.repository }} labels: | @@ -68,20 +71,20 @@ jobs: suffix=${{ matrix.suffix }} - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - name: Login to DockerHub - uses: docker/login-action@v3 + uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 if: ${{ inputs.publish }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to Quay - uses: docker/login-action@v3 + uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 if: ${{ inputs.publish }} with: registry: quay.io @@ -89,7 +92,7 @@ jobs: password: ${{ secrets.QUAY_TOKEN }} - name: ${{ inputs.publish && 'Build and push' || 'Build' }} - uses: docker/build-push-action@v5 + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 with: context: . file: ./${{ matrix.Dockerfile }} diff --git a/.github/workflows/release-assets.yaml b/.github/workflows/release-assets.yaml index 2fe3fc3..a07a478 100644 --- a/.github/workflows/release-assets.yaml +++ b/.github/workflows/release-assets.yaml @@ -8,14 +8,14 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set Swap Space uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c with: swap-size-gb: 12 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: '1.21' check-latest: true @@ -25,7 +25,7 @@ jobs: make release-assets - name: Upload assets to release - uses: svenstaro/upload-release-action@v2 + uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # latest with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./release-assets/* diff --git a/.golangci.yaml b/.golangci.yaml index 4496150..24b3e3e 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,26 +1,35 @@ -run: - timeout: 120m - +version: "2" linters: enable: - asciicheck - bidichk - bodyclose - errorlint - - exportloopref + - gosec + settings: + gosec: + confidence: low + config: + global: + audit: true + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: - gofmt - goimports - - gosec - -linters-settings: - gosec: - excludes: [] - confidence: low - config: - global: - audit: true - -issues: {} - -output: - sort-results: true + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/README.md b/README.md index 6e87a24..8c26a3a 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,15 @@ +# Fork Provenance + +This is an amazee.io-managed minimally maintained fork of the upstream repository at https://github.com/webdevops/go-crond. + # go-crond -[![GitHub release](https://img.shields.io/github/release/webdevops/go-crond.svg)](https://github.com/webdevops/go-crond/releases) + A cron daemon written in golang diff --git a/main.go b/main.go index af75fd9..a3e3be0 100644 --- a/main.go +++ b/main.go @@ -130,8 +130,7 @@ func includePathsForCrontabs(paths []string, username string) []CrontabEntry { func includePathForCrontabs(path string, username string) []CrontabEntry { var ret []CrontabEntry - var paths []string = []string{path} - + paths := []string{path} findFilesInPaths(paths, func(f os.FileInfo, path string) { entries := parseCrontab(path, username) ret = append(ret, entries...) @@ -160,7 +159,7 @@ func includeRunPartsDirectory(spec string, path string) []CrontabEntry { user, path = split[0], split[1] } - var paths []string = []string{path} + paths := []string{path} findExecutabesInPathes(paths, func(f os.FileInfo, path string) { ret = append(ret, CrontabEntry{Spec: spec, User: user, Command: path}) })