Skip to content
Closed
23 changes: 20 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,24 @@ jobs:
with:
go-version-file: go.mod
- run: go version

- name: Setup Docker on macOS
uses: docker-practice/actions-setup-docker@master

Choose a reason for hiding this comment

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

It's not recommended to use the master branch of an action as it can introduce breaking changes without notice. Use a specific version or commit hash for docker-practice/actions-setup-docker to ensure stability.

timeout-minutes: 12

Choose a reason for hiding this comment

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

The timeout-minutes attribute should be aligned with the uses attribute for consistency and readability.

- run: |
set -x

Choose a reason for hiding this comment

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

The set -x command will print all executed commands to the terminal, which can clutter the build logs. Consider removing it unless it's necessary for debugging purposes.


docker version

docker run --rm hello-world

Choose a reason for hiding this comment

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

Running hello-world Docker image doesn't seem to serve a purpose in the CI workflow. If it's meant for testing the Docker setup, please ensure it's relevant to the project's CI goals.


- name: Login to Docker Hub

Choose a reason for hiding this comment

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

The Login to Docker Hub step appears to be redundant since you've already added a Log in to Docker Hub step above. Consider removing this duplicate step to streamline the workflow.

uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 #v1

Choose a reason for hiding this comment

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

Using a commit SHA (dd4fa0671be5250ee6f50aedf4cb05514abda2c7) directly for the docker/login-action is not recommended for maintainability. Prefer using a version tag (like v1) unless there is a specific reason for pinning to a commit.

with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: go test with coverage
shell: bash
run: |
sudo chmod +x ./internal/commands/.scripts/up.sh
./internal/commands/.scripts/up.sh
Expand Down Expand Up @@ -66,7 +83,7 @@ jobs:
PR_GITHUB_NAMESPACE: "checkmarx"
PR_GITHUB_REPO_NAME: "ast-cli"
PR_GITHUB_NUMBER: 983
PR_GITLAB_TOKEN : ${{ secrets.PR_GITLAB_TOKEN }}
PR_GITLAB_TOKEN: ${{ secrets.PR_GITLAB_TOKEN }}
PR_GITLAB_NAMESPACE: ${{ secrets.PR_GITLAB_NAMESPACE }}
PR_GITLAB_REPO_NAME: ${{ secrets.PR_GITLAB_REPO_NAME }}
PR_GITLAB_PROJECT_ID: ${{ secrets.PR_GITLAB_PROJECT_ID }}
Expand Down Expand Up @@ -158,7 +175,7 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build the project
run: go build -o ./cx ./cmd
run: go build -o ./cx ./cmd

Choose a reason for hiding this comment

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

Consider using the -v flag with go build for verbose output to provide more context on the build process in the CI logs.

- name: Build Docker image
run: docker build -t ast-cli:${{ github.sha }} .
- name: Run Trivy scanner without downloading DBs
Expand All @@ -175,7 +192,7 @@ jobs:
env:
TRIVY_SKIP_DB_UPDATE: true
TRIVY_SKIP_JAVA_DB_UPDATE: true

Choose a reason for hiding this comment

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

It seems like there is an unnecessary change from a tab to a space on this line. Please revert it if it does not serve a specific purpose.

- name: Inspect action report
if: always()
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

</div>

<!-- PROJECT LOGO -->
<!-- PROJECT LOGO -->
<br />
<p align="center">
<a href="">
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/checkmarx/ast-cli

go 1.23.3
go 1.23.5

Choose a reason for hiding this comment

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

The go version is updated from 1.23.3 to 1.23.5. Please ensure that this minor version bump does not introduce any compatibility issues with the project dependencies and that all tests pass with the new version.


require (
github.com/Checkmarx/containers-resolver v1.0.4
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const (
containerVolumeFlag = "-v"
containerNameFlag = "--name"
containerRemove = "--rm"
containerImage = "checkmarx/kics:latest"
containerImage = "checkmarx/kics:v2.1.3"

Choose a reason for hiding this comment

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

The container image tag has been changed to include a v prefix. Ensure that the tag v2.1.3 exists in the container registry and is the correct version intended for use. If this is a new tagging convention, update any documentation or scripts that reference the old tag format to prevent confusion.

containerScan = "scan"
containerScanPathFlag = "-p"
containerScanPath = "/path"
Expand Down
Loading