Skip to content

feat: Add GitHub Actions workflows for CI (linting and build) and Doc…#1

Merged
DDRMin merged 3 commits into
mainfrom
dev
Feb 19, 2026
Merged

feat: Add GitHub Actions workflows for CI (linting and build) and Doc…#1
DDRMin merged 3 commits into
mainfrom
dev

Conversation

@DDRMin

@DDRMin DDRMin commented Feb 19, 2026

Copy link
Copy Markdown
Owner

…ker image building/pushing.

@DDRMin DDRMin requested a review from Copilot February 19, 2026 09:26
@DDRMin DDRMin merged commit 3fa9e3d into main Feb 19, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds GitHub Actions automation for pull-request CI (lint/build) and adjusts Docker image build/push behavior, alongside small HTTP response-write error handling improvements in the Go API.

Changes:

  • Add a PR-triggered CI workflow to run golangci-lint and go build.
  • Update Docker workflow triggers/behavior to push images on main and version tags.
  • Add error handling for JSON encoding and health check response writes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
internal/json/json.go Adds error handling around JSON encoding in the response helper.
cmd/api.go Logs an error if writing the health check response fails.
.github/workflows/docker.yml Removes PR trigger and makes image push unconditional for main/tag pushes.
.github/workflows/ci.yml Introduces PR CI workflow for linting and build verification.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/json/json.go
Comment on lines 10 to +14
w.WriteHeader(status)
json.NewEncoder(w).Encode(data)

if err := json.NewEncoder(w).Encode(data); err != nil {
http.Error(w, "Failed to encode response", http.StatusInternalServerError)
}

Copilot AI Feb 19, 2026

Copy link

Choose a reason for hiding this comment

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

WriteHeader(status) is called before encoding the JSON. If Encode fails, the response status/headers are already committed and http.Error cannot reliably change the status to 500; it can also produce a partially-written/invalid JSON response. Consider encoding to a buffer first (then write status/body only on success), or change Write to return an error so callers can decide how to respond before headers are written.

Copilot uses AI. Check for mistakes.
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