diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 533c0a17e..08083423f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: jobs: unit-tests: runs-on: ubuntu-latest + permissions: + contents: read + packages: read steps: - name: Checkout the repository uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 #v4.0.0 @@ -14,7 +17,26 @@ jobs: with: go-version-file: go.mod - run: go version + + - name: Set up Docker + uses: docker/setup-buildx-action@cf09c5c41b299b55c366aff30022701412eb6ab0 #v1.0.0 + with: + version: latest + + - name: Set Docker permissions + run: | + sudo chmod 666 /var/run/docker.sock + sudo systemctl start docker + docker --version + + - name: Log in to Docker Hub + uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b #v2 + 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 @@ -66,7 +88,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 }} @@ -158,7 +180,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 - name: Build Docker image run: docker build -t ast-cli:${{ github.sha }} . - name: Run Trivy scanner without downloading DBs @@ -175,7 +197,7 @@ jobs: env: TRIVY_SKIP_DB_UPDATE: true TRIVY_SKIP_JAVA_DB_UPDATE: true - + - name: Inspect action report if: always() shell: bash diff --git a/README.md b/README.md index 2e479f5f2..39bf205ab 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ - +

diff --git a/go.mod b/go.mod index d02e4fd2d..8c3462deb 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/checkmarx/ast-cli -go 1.23.3 +go 1.23.5 require ( github.com/Checkmarx/containers-resolver v1.0.4 diff --git a/internal/commands/scan.go b/internal/commands/scan.go index f26973a13..d04a0727f 100644 --- a/internal/commands/scan.go +++ b/internal/commands/scan.go @@ -60,7 +60,7 @@ const ( containerVolumeFlag = "-v" containerNameFlag = "--name" containerRemove = "--rm" - containerImage = "checkmarx/kics:latest" + containerImage = "checkmarx/kics:v2.1.3" containerScan = "scan" containerScanPathFlag = "-p" containerScanPath = "/path"