-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Stop to use postgreSQL * Remove SQLC workflow configuration * Fix gosec error * fix build issue * Update Dockerfile with Go 1.22 and Trivy 0.50.4 * Update Docker build and push actions, manage Go build cache * Add support for linux/arm64 in platforms configuration * Comment out platforms in publish workflow file * Add BigQuery client to infrastructure in New() function * remove debug code * Add firestore DB * Update go packages * Add firestore insertion * Add utility function to hash branch names * Add hex encoding to HashBranch and create hash_test.go * Use Cloud Storage for scan report repository instead of Firebase * Remove h1 * Save object data with gzip encoding * Update comment message * fix tests * test * ignore draft PR * Update ListIssueComments receiver to pointer type * Impelement GitHub check * Update check conclusion to "cancelled" in ScanGitHubRepo * Add impoersonation for BigQuery * Adjust impersonation scopes * Add policy client * Update GitHub comment format * Update references display in test and comment body template * Update comment_body.md template with consistent emoji usage * Update detected vulnerabilities section icon to warning sign * Add support for BigQuery service account impersonation
- Loading branch information
1 parent
85ca7d3
commit f1410dc
Showing
89 changed files
with
4,522 additions
and
2,474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,31 +11,61 @@ env: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Go Build Cache for Docker | ||
uses: actions/cache@v3 | ||
with: | ||
path: go-build-cache | ||
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('go.sum') }} | ||
|
||
- name: inject go-build-cache into docker | ||
# v1 was composed of two actions: "inject" and "extract". | ||
# v2 is unified to a single action. | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: go-build-cache | ||
|
||
- name: Set up Docker buildx | ||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 | ||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 | ||
|
||
- name: Get the tag or commit id | ||
id: version | ||
run: | | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
# If a tag is present, strip the 'refs/tags/' prefix | ||
TAG_OR_COMMIT=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | ||
echo "This is a tag: $TAG_OR_COMMIT" | ||
else | ||
# If no tag is present, use the commit SHA | ||
TAG_OR_COMMIT=$(echo $GITHUB_SHA) | ||
echo "This is a commit SHA: $TAG_OR_COMMIT" | ||
fi | ||
# Set the variable for use in other steps | ||
echo "TAG_OR_COMMIT=$TAG_OR_COMMIT" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ env.GITHUB_IMAGE_NAME }} | ||
build-args: | | ||
BUILD_VERSION=${{ steps.version.outputs.TAG_OR_COMMIT }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
- uses: actions/checkout@v2 | ||
# platforms: linux/amd64,linux/arm64 | ||
- name: Slack Notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 # v2.2.0 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_MESSAGE: "Pushed to ${{ env.GITHUB_IMAGE_NAME }}" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ assets/.next | |
/*.json | ||
|
||
tmp | ||
/pkg/usecase/templates/test_* | ||
|
||
trivy.db | ||
octovy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
FROM golang:1.21-bullseye AS build-go | ||
COPY . /app | ||
FROM golang:1.22 AS build-go | ||
ENV CGO_ENABLED=0 | ||
ARG BUILD_VERSION | ||
|
||
WORKDIR /app | ||
# ENV CGO_ENABLED=0 | ||
RUN go get -v | ||
RUN go build . | ||
RUN go env -w GOMODCACHE=/root/.cache/go-build | ||
|
||
COPY go.mod go.sum ./ | ||
RUN --mount=type=cache,target=/root/.cache/go-build go mod download | ||
|
||
COPY . /app | ||
RUN --mount=type=cache,target=/root/.cache/go-build go build -o octovy -ldflags "-X github.com/m-mizutani/octovy/pkg/domain/types.AppVersion=${BUILD_VERSION}" . | ||
|
||
FROM gcr.io/distroless/base:nonroot | ||
USER nonroot | ||
COPY --from=build-go /app/octovy /octovy | ||
COPY --from=build-go /app/database /database | ||
COPY --from=aquasec/trivy:0.45.1 /usr/local/bin/trivy /trivy | ||
COPY --from=aquasec/trivy:0.50.4 /usr/local/bin/trivy /trivy | ||
WORKDIR / | ||
ENV OCTOVY_ADDR="0.0.0.0:8000" | ||
ENV OCTOVY_TRIVY_PATH=/trivy | ||
EXPOSE 8000 | ||
ENTRYPOINT [ "/octovy" ] | ||
|
||
ENTRYPOINT ["/octovy"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.