Skip to content

ci: harden workflows, upgrade actions, fix caching#248

Merged
umputun merged 1 commit intoumputun:masterfrom
paskal:ci/workflow-hardening
Mar 14, 2026
Merged

ci: harden workflows, upgrade actions, fix caching#248
umputun merged 1 commit intoumputun:masterfrom
paskal:ci/workflow-hardening

Conversation

@paskal
Copy link
Contributor

@paskal paskal commented Mar 7, 2026

Summary

  • add explicit permissions for least-privilege (contents: read/write, packages: write)
  • upgrade all actions to latest major versions (checkout@v6, setup-go@v6, setup-buildx@v4, login-action@v4, build-push-action@v7, upload-artifact@v7, download-artifact@v8, goreleaser-action@v7, setup-qemu-action@v4)
  • add persist-credentials: false to all checkout steps
  • combine goveralls install and coverage submission into single step
  • quote golangci-lint version string for YAML consistency

@paskal paskal requested a review from umputun as a code owner March 7, 2026 19:33
@paskal paskal force-pushed the ci/workflow-hardening branch 3 times, most recently from 0b58602 to 7710f99 Compare March 10, 2026 21:03
Copy link
Owner

@umputun umputun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple issues:

  1. bug in app/main.go:304 — the error variable was changed from perr to err, but the assignment on line 301 still uses perr. this wraps the wrong error:
maxBodySize, perr := sizeParse(opts.MaxSize)
if perr != nil {
    return fmt.Errorf("failed to convert MaxSize: %w", err) // should be perr
}
  1. app/mgmt/metrics.go removes the Flush() method and server_test.go removes its tests — this reverts #247 (SSE streaming fix) merged a few days ago. was this intentional?

  2. docker.yml replaces the env: var approach from #245 with direct ${{ }} in run: blocks. the env approach was specifically chosen to prevent shell injection — putting expressions back inline in run blocks reverses that hardening.

  3. the Go source changes (main.go alignment, defer cancel, server.go shutdown timeout, metrics.go Flusher removal) are unrelated to CI hardening. would be cleaner to split them into a separate PR, or at least mention them in the description.

CI workflow upgrades and permissions changes look good overall.

@paskal paskal force-pushed the ci/workflow-hardening branch from 7710f99 to 6575fd8 Compare March 14, 2026 07:55
@paskal paskal force-pushed the ci/workflow-hardening branch from 6575fd8 to 6deccaa Compare March 14, 2026 08:01
@paskal
Copy link
Contributor Author

paskal commented Mar 14, 2026

Reverted all the go changes, fixed the env usage. Should be solid now.

@umputun umputun merged commit feac4fe into umputun:master Mar 14, 2026
2 of 3 checks passed
@paskal paskal deleted the ci/workflow-hardening branch March 14, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants