mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2025-09-20 01:57:16 +00:00
Fix Lint errors and resort GitHub action steps.
This commit is contained in:
parent
1d63750e87
commit
90d6c1c39e
12
.github/workflows/pull_request.yml
vendored
12
.github/workflows/pull_request.yml
vendored
|
@ -7,7 +7,7 @@ permissions:
|
|||
contents: read
|
||||
|
||||
jobs:
|
||||
lint_build_test:
|
||||
integrate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
@ -18,12 +18,12 @@ jobs:
|
|||
with:
|
||||
go-version-file: "go.mod"
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.52.2
|
||||
|
||||
- name: Build and test
|
||||
run: |
|
||||
go build -v ./...
|
||||
go test -v ./...
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.52.2
|
||||
|
|
|
@ -44,7 +44,7 @@ func execCommand(name string, arg ...string) string {
|
|||
cmd := exec.Command(name, arg...)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("Error code %d encountered while running %s\n%s", cmd.ProcessState.ExitCode(), strings.Join(cmd.Args, " "), string(out)))
|
||||
fmt.Fprintf(os.Stderr, "Error code %d encountered while running %s\n%s\n", cmd.ProcessState.ExitCode(), strings.Join(cmd.Args, " "), string(out))
|
||||
os.Exit(2)
|
||||
}
|
||||
return string(out)
|
||||
|
@ -97,10 +97,11 @@ func main() {
|
|||
pkgNames := os.Args[2:]
|
||||
|
||||
switch command {
|
||||
|
||||
case "normalized-list":
|
||||
pkgs := getPackages(pkgNames)
|
||||
fmt.Println(pkgs.serialize())
|
||||
break
|
||||
|
||||
default:
|
||||
exitOnError("Command '%s' not recognized.", command)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue