1
0
Fork
You've already forked nice
0

Add Go GitHub Actions CI workflow #3

Merged
antonyho merged 4 commits from go-ci-workflow into master 2025年06月08日 22:32:39 +02:00
antonyho commented 2025年06月08日 22:22:25 +02:00 (Migrated from github.com)
Copy link
No description provided.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025年06月08日 22:23:12 +02:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment
Copy link

Pull Request Overview

Adds a new GitHub Actions workflow to automatically run Go tests on commits and pull requests.

  • Introduces .github/workflows/go.yml to checkout code, set up Go, and execute go test
  • Triggers the workflow on pushes and pull requests to the default branch
Comments suppressed due to low confidence (2)

.github/workflows/go.yml:1

  • [nitpick] The comment says 'build' but the workflow only runs tests; consider updating it to accurately describe testing or add a build step.
# This workflow will build a golang project

.github/workflows/go.yml:14

  • [nitpick] The job is named 'build' but only runs tests; consider renaming it to 'test' for clarity or extending it to include build steps.
 build:
## Pull Request Overview Adds a new GitHub Actions workflow to automatically run Go tests on commits and pull requests. - Introduces `.github/workflows/go.yml` to checkout code, set up Go, and execute `go test` - Triggers the workflow on pushes and pull requests to the default branch <details> <summary>Comments suppressed due to low confidence (2)</summary> **.github/workflows/go.yml:1** * [nitpick] The comment says 'build' but the workflow only runs tests; consider updating it to accurately describe testing or add a build step. ``` # This workflow will build a golang project ``` **.github/workflows/go.yml:14** * [nitpick] The job is named 'build' but only runs tests; consider renaming it to 'test' for clarity or extending it to include build steps. ``` build: ``` </details>
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025年06月08日 22:23:11 +02:00
Copy link

The default branch is likely named 'main'; update this trigger to reference the correct default branch or use the repository default branch variable.

 branches: [ "${{ github.event.repository.default_branch }}" ]
 pull_request:
 branches: [ "${{ github.event.repository.default_branch }}" ]
The default branch is likely named 'main'; update this trigger to reference the correct default branch or use the repository default branch variable. ```suggestion branches: [ "${{ github.event.repository.default_branch }}" ] pull_request: branches: [ "${{ github.event.repository.default_branch }}" ] ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025年06月08日 22:23:12 +02:00
Copy link

Same as above: ensure pull_request triggers target the correct default branch (e.g., 'main').

 branches: [ "main" ]
 pull_request:
 branches: [ "main" ]
Same as above: ensure pull_request triggers target the correct default branch (e.g., 'main'). ```suggestion branches: [ "main" ] pull_request: branches: [ "main" ] ```
@ -0,0 +18,4 @@
runs-on:ubuntu-latest
steps:
- uses:actions/checkout@v4
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025年06月08日 22:23:12 +02:00
Copy link

Consider adding an actions/cache step for Go modules after checkout to speed up subsequent workflow runs.


 - name: Cache Go modules
 uses: actions/cache@v3
 with:
 path: |
 ~/.cache/go-build
 $GOPATH/pkg/mod
 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
 restore-keys: |
 ${{ runner.os }}-go-
Consider adding an actions/cache step for Go modules after checkout to speed up subsequent workflow runs. ```suggestion - name: Cache Go modules uses: actions/cache@v3 with: path: | ~/.cache/go-build $GOPATH/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- ```
github-advanced-security[bot] (Migrated from github.com) reviewed 2025年06月08日 22:23:22 +02:00
github-advanced-security[bot] (Migrated from github.com) commented 2025年06月08日 22:23:22 +02:00
Copy link

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}

Show more details

## Workflow does not contain permissions Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}} [Show more details](https://github.com/antonyho/nice/security/code-scanning/1)
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
antonyho/nice!3
Reference in a new issue
antonyho/nice
No description provided.
Delete branch "go-ci-workflow"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?