Skip to content

Commit

Permalink
Merge pull request #10 from sarg3nt/attempt-fix-trivy-db-download-tim…
Browse files Browse the repository at this point in the history
…eout

Attempt to fix trivy db download error due to too many calls by logginginto ghcr
  • Loading branch information
sarg3nt authored Oct 29, 2024
2 parents e7debc0 + ece7f81 commit 29ab5e1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
schedule:
- cron: '19 14 * * 5'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

permissions:
contents: read

Expand All @@ -26,6 +30,16 @@ jobs:
name: Build
runs-on: "ubuntu-20.04"
steps:
# - name: Authenticate to GitHub Container Registry
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Log into registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
Expand All @@ -34,9 +48,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Build an image from Dockerfile
run: |
docker build -t ghcr.io/sarg3nt/go-docker-container:${{ github.sha }} .
- name: Build and push Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
context: .
push: false
tags: ${{ github.sha }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@7b7aa264d83dc58691451798b4d117d53d21edfe
Expand Down
2 changes: 1 addition & 1 deletion scripts/20_install_microsoft_dev_container_features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ IFS=$'\n\t'
# See: https://github.com/devcontainers/features
main() {
source "/usr/bin/lib/sh/log.sh"
log "20-install-microsoft-dev-container-features.sh" "blue"
log "20_install_microsoft_dev_container_features.sh" "blue"

log "Exporting zshell variables" "green"
export CONFIGUREZSHASDEFAULTSHELL=true
Expand Down

0 comments on commit 29ab5e1

Please sign in to comment.