Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: v.oleynikov <[email protected]>
  • Loading branch information
duckhawk committed Aug 30, 2024
1 parent fc6e820 commit 763a634
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/trivy_image_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@ jobs:
runs-on: [self-hosted, regular]

steps:
- name: Detect platform and install Trivy
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
OS=$(grep '^ID=' /etc/os-release | cut -d '=' -f 2 | tr -d '"')
if [[ "$OS" == "ubuntu" ]] || [[ "$OS" == "debian" ]]; then
VERSION=$(curl -sL https://api.github.com/repos/aquasecurity/trivy/releases/latest | jq -r ".tag_name")
wget https://github.com/aquasecurity/trivy/releases/download/$VERSION/trivy_$VERSION_Linux-64bit.deb
sudo dpkg -i trivy_$VERSION_Linux-64bit.deb
elif [[ "$OS" == "rhel" ]] || [[ "$OS" == "centos" ]] || [[ "$OS" == "fedora" ]] || [[ "$OS" == "redos" ]]; then
VERSION=$(curl -sL https://api.github.com/repos/aquasecurity/trivy/releases/latest | jq -r ".tag_name")
wget https://github.com/aquasecurity/trivy/releases/download/$VERSION/trivy_$VERSION_Linux-64bit.rpm
sudo rpm -ivh trivy_$VERSION_Linux-64bit.rpm
else
echo "Unsupported Linux distribution"
exit 1
fi
else
echo "Unsupported OS"
exit 1
fi
- name: Run Trivy vulnerability scanner in image mode
run: |
success=1
Expand Down

0 comments on commit 763a634

Please sign in to comment.