This commit addresses several issues identified in a code review to improve the overall quality and robustness of the application. Key changes include: - Refactored `cmd.Execute()` to return an error instead of calling `os.Exit`, making the application more testable. - Fixed critical issues in `cmd/main_test.go`, including renaming `TestMain` to avoid conflicts and removing the brittle E2E test. - Improved the GitHub API client in `pkg/github/github.go` by: - Fixing a resource leak where an HTTP response body was not being closed. - Restoring a parameterized function to improve testability. - Adding support for `context.Context` and API pagination for robustness. - Updated the `.github/workflows/go.yml` CI workflow to use the `Taskfile.yml` for building and testing, ensuring consistency. - Added a `test` task to `Taskfile.yml`. - Ran `go mod tidy` and fixed several unused import errors.
29 lines
575 B
YAML
29 lines
575 B
YAML
# This workflow will build a golang project
|
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
|
|
|
name: Go
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Install Task
|
|
run: go install github.com/go-task/task/v3/cmd/task@latest
|
|
|
|
- name: Build
|
|
run: ~/go/bin/task build
|
|
|
|
- name: Test
|
|
run: ~/go/bin/task test
|