Skip to content

Commit

Permalink
Merge pull request #55 from dell/add-go-version-workflow
Browse files Browse the repository at this point in the history
Add go version update worklow
  • Loading branch information
falfaroc authored Oct 9, 2024
2 parents 348bace + 6239d85 commit 3edeaab
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/go-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

# Reusable workflow to perform go version update on Golang based projects
name: Go Version Update

on:
workflow_dispatch:
repository_dispatch:
types: [go-update-workflow]

jobs:
# go version update
go-version-update:
uses: dell/common-github-actions/.github/workflows/go-version-workflow.yaml@main
name: Go Version Update
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
go mod vendor
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
uses: golangci/golangci-lint-action@v6
with:
version: latest
skip-cache: true
2 changes: 2 additions & 0 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ func ValidateDuration(durationStr string) (uint64, error) {
if minutes >= 60 || minutes < 0 || secs >= 60 || secs < 0 {
return 0, errors.New("hours, minutes and seconds should be in between 0-60")
}

// #nosec G115
seconds := uint64(days*24*60*60 + hours*60*60 + minutes*60 + secs)
return seconds, nil
}
Expand Down

0 comments on commit 3edeaab

Please sign in to comment.