File tree Expand file tree Collapse file tree 2 files changed +19
-25
lines changed
Expand file tree Collapse file tree 2 files changed +19
-25
lines changed Original file line number Diff line number Diff line change 1616 - master
1717 - main
1818
19- permissions :
20- contents : write # Required to push to gh-pages branch
21- pages : write
22- id-token : write
23- pull-requests : write
24- actions : read
25-
2619jobs :
2720 # Build and deploy docs preview for opened/updated PRs
2821 build-preview :
29- if : github.event.action != 'closed'
22+ permissions :
23+ contents : write # Push to gh-pages branch
24+ pull-requests : write # Create/update preview comment
25+ # SECURITY: Only run on pull_request trigger (not pull_request_target) to prevent
26+ # untrusted fork PRs from executing code with write permissions (RCE vulnerability)
27+ if : github.event_name == 'pull_request' && github.event.action != 'closed'
3028 runs-on : ubuntu-latest
3129 steps :
3230 - name : 📂 Checkout PR code
@@ -126,6 +124,9 @@ jobs:
126124
127125 # Clean up preview when PR is closed/merged
128126 cleanup-preview :
127+ permissions :
128+ contents : write # Push to gh-pages branch
129+ pull-requests : write # Update comment on cleanup
129130 if : github.event.action == 'closed'
130131 runs-on : ubuntu-latest
131132 steps :
Original file line number Diff line number Diff line change @@ -46,26 +46,19 @@ jobs:
4646 --bare \
4747 --tags=${{ github.ref_name }},latest
4848
49- - name : 🔍 Install Trivy
50- run : |
51- wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
52- echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
53- sudo apt-get update
54- sudo apt-get install trivy
55-
5649 - name : 📋 Generate SBOM (SPDX format)
57- run : |
58- trivy image \
59- --format spdx-json \
60- --output sbom- spdx. json \
61- ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}
50+ uses : aquasecurity/trivy-action@0.29.0
51+ with :
52+ image-ref : ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}
53+ format : spdx- json
54+ output : sbom-spdx.json
6255
6356 - name : 📋 Generate SBOM (CycloneDX format)
64- run : |
65- trivy image \
66- --format cyclonedx \
67- --output sbom- cyclonedx.json \
68- ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}
57+ uses : aquasecurity/trivy-action@0.29.0
58+ with :
59+ image-ref : ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}
60+ format : cyclonedx
61+ output : sbom-cyclonedx.json
6962
7063 - name : 📦 Upload SBOMs to release
7164 uses : softprops/action-gh-release@v2
You can’t perform that action at this time.
0 commit comments