Skip to content

Commit

Permalink
ingest with kusari-uploader
Browse files Browse the repository at this point in the history
Signed-off-by: Sunny Yip <[email protected]>
  • Loading branch information
sunnyyip committed May 31, 2024
1 parent ee8701e commit 20a1d4c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 9 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Test

on:
workflow_dispatch:
push:
# branches:
# - main

permissions:
contents: read
id-token: write

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0

- name: clone guac-data
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
with:
repository: 'guacsec/guac-data'
ref: 'main'
path: 'guac-data'

- name: ingest to guac
uses: ./
continue-on-error: true
with:
files: ./guac-data/docs
client-id: ${{ secrets.GUAC_CLIENT_ID }}
client-secret: ${{ secrets.GUAC_CLIENT_SECRET }}
tenant-api-endpoint: https://ingesttest.api.dev.kusari.cloud
auth-server-token-endpoint: https://auth.dev.kusari.cloud/oauth2/token

- name: last step
shell: bash
run: |
echo "This runs after GUAC ingestion"
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM cgr.dev/chainguard/go AS builder
COPY . /app
RUN cd /app && go build -o guac-github-action .
# FROM cgr.dev/chainguard/go AS builder
# COPY . /app
# RUN cd /app && go build -o guac-github-action .

FROM cgr.dev/chainguard/glibc-dynamic
COPY --from=builder /app/guac-github-action /usr/bin/
ENTRYPOINT ["/usr/bin/guac-github-action"]
# FROM cgr.dev/chainguard/glibc-dynamic
# COPY --from=builder /app/guac-github-action /usr/bin/
# ENTRYPOINT ["/usr/bin/guac-github-action"]

FROM ghcr.io/kusaridev/kusari-uploader:latest
6 changes: 3 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
files:
description: 'path to directory or specific file to ingest'
required: true
gql-addr:
api-addr:
description: 'endpoint for graphql api for GUAC'
required: true
token-url:
Expand All @@ -30,7 +30,7 @@ runs:
image: 'Dockerfile'
args:
- ${{ inputs.files }}
- ${{ inputs.gql-addr }}
- ${{ inputs.token-url }}
- ${{ inputs.client-id }}
- ${{ inputs.client-secret }}
- ${{ inputs.api-addr }}
- ${{ inputs.token-url }}

0 comments on commit 20a1d4c

Please sign in to comment.