Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -68,28 +71,28 @@ 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
username: ${{ secrets.QUAY_USERNAME }}
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 }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/*
Expand Down
45 changes: 27 additions & 18 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -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$
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
<!-- [![GitHub release](https://img.shields.io/github/release/webdevops/go-crond.svg)](https://github.com/webdevops/go-crond/releases)
[![license](https://img.shields.io/github/license/webdevops/go-crond.svg)](https://github.com/webdevops/go-crond/blob/master/LICENSE)
[![DockerHub](https://img.shields.io/badge/DockerHub-webdevops%2Fgo--crond-blue)](https://hub.docker.com/r/webdevops/go-crond/)
[![Quay.io](https://img.shields.io/badge/Quay.io-webdevops%2Fgo--crond-blue)](https://quay.io/repository/webdevops/go-crond)
[![Github All Releases](https://img.shields.io/github/downloads/webdevops/go-crond/total.svg)]()
[![Github Releases](https://img.shields.io/github/downloads/webdevops/go-crond/latest/total.svg)]()
[![Github Releases](https://img.shields.io/github/downloads/webdevops/go-crond/latest/total.svg)]() -->

A cron daemon written in golang

Expand Down
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down Expand Up @@ -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})
})
Expand Down
Loading