1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-06 16:00:28 +01:00

Update main.yml

This commit is contained in:
Noxcis 2024-08-24 02:53:30 -05:00 committed by GitHub
parent 9fe2aa9ed5
commit 99db8c7335
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,14 +26,38 @@ jobs:
- name: Build Docker image - name: Build Docker image
id: build-image id: build-image
run: | run: |
echo "Building Docker image..."
docker build -t my-app-image:latest . docker build -t my-app-image:latest .
echo "Docker image built successfully."
- name: Install Docker Scout - name: Install Docker Scout
run: | run: |
echo "Installing Docker Scout..."
curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s -- curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s --
echo "Docker Scout installed successfully."
- name: Analyze Docker image with Docker Scout - name: Analyze Docker image with Docker Scout
id: analyze-image id: analyze-image
run: | run: |
docker scout cves my-app-image:latest > scout-results.json echo "Analyzing Docker image with Docker Scout..."
cat scout-results.json # Print the report to the workflow logs for easy viewing docker scout cves my-app-image:latest > scout-results.txt
cat scout-results.txt # Print the report to the workflow logs for easy viewing
echo "Docker Scout analysis completed."
- name: Create GitHub issue comment
uses: peter-evans/create-issue-comment@v3
with:
issue-number: 1 # Replace with the issue number or use an appropriate method to identify the issue or PR
body: |
**Docker Image Build and Analysis Report**
The Docker image was built and analyzed successfully.
**Build Summary:**
- Image Tag: my-app-image:latest
**Analysis Report:**
```
$(cat scout-results.txt)
```
token: ${{ secrets.GITHUB_TOKEN }}