Skip to content

Commit

Permalink
Moved all workflows to a single repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Fgerthoffert authored Sep 30, 2024
1 parent 7ec0e19 commit 1321407
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/trivy-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Inspiration taken from: https://github.com/aquasecurity/trivy-checks/blob/main/.github/workflows/release.yaml
name: Refresh Trivy Checks Clone

on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'

env:
VERSION: 0
GH_USER: jahia-ci

jobs:
build:
name: Build DB
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Install oras
run: |
# upgrade to ORAS 1.0.0
curl -LO https://github.com/oras-project/oras/releases/download/v1.0.0/oras_1.0.0_linux_amd64.tar.gz
tar -xvf ./oras_1.0.0_linux_amd64.tar.gz
- name: Download latest version of the DB
run: |
./oras pull ghcr.io/aquasecurity/trivy-checks:${{ env.VERSION }}
- name: Login to GitHub Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.GH_USER }}
password: ${{ secrets.GH_PACKAGES_TOKEN }}

- name: Upload assets to GHCR
run: |
./oras version
./oras push ghcr.io/jahia/trivy-checks:${{ env.VERSION }} \
--config /dev/null:application/vnd.cncf.openpolicyagent.config.v1+json \
bundle.tar.gz:application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Refresh Trivy DB Clone
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
- cron: '0 0 * * *'

env:
VERSION: 2
Expand Down Expand Up @@ -40,4 +40,4 @@ jobs:
./oras version
./oras push --artifact-type application/vnd.aquasec.trivy.config.v1+json \
ghcr.io/jahia/trivy-db:${{ env.VERSION }} \
db.tar.gz:application/vnd.aquasec.trivy.db.layer.v1.tar+gzip
db.tar.gz:application/vnd.aquasec.trivy.db.layer.v1.tar+gzip
43 changes: 43 additions & 0 deletions .github/workflows/trivy-java-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Inspiration taken from: https://github.com/aquasecurity/trivy-java-db/blob/main/.github/workflows/cron.yml
name: Refresh Trivy Java DB Clone

on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'

env:
VERSION: 1
GH_USER: jahia-ci

jobs:
build:
name: Build DB
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Install oras
run: |
# upgrade to ORAS 1.0.0
curl -LO https://github.com/oras-project/oras/releases/download/v1.0.0/oras_1.0.0_linux_amd64.tar.gz
tar -xvf ./oras_1.0.0_linux_amd64.tar.gz
- name: Download latest version of the DB
run: |
./oras pull ghcr.io/aquasecurity/trivy-java-db:${{ env.VERSION }}
- name: Login to GitHub Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.GH_USER }}
password: ${{ secrets.GH_PACKAGES_TOKEN }}

- name: Upload assets to GHCR
run: |
./oras version
./oras push --artifact-type application/vnd.aquasec.trivy.config.v1+json \
ghcr.io/jahia/trivy-java-db:${{ env.VERSION }} \
javadb.tar.gz:application/vnd.aquasec.trivy.javadb.layer.v1.tar+gzip

0 comments on commit 1321407

Please sign in to comment.