Refactored Dockerfile to reduce size. xDebug now a separate build stage #84
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://github.com/aquasecurity/trivy-action | |
| name: Trivy Scan | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| # The branches below must be a subset of the branches above | |
| branches: [ "main" ] | |
| schedule: | |
| - cron: '43 11 * * 6' | |
| permissions: | |
| contents: read # for actions/checkout to fetch code | |
| security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | |
| actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
| env: | |
| IMAGE_NAME: appwrite/base | |
| REGISTRY: docker.io | |
| jobs: | |
| scheduled_trivy: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6.0.2 | |
| - name: Build an image from Dockerfile | |
| run: | | |
| docker image build --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} . | |
| - name: Run Trivy vulnerability scanner (sarif report) | |
| uses: aquasecurity/trivy-action@0.35.0 | |
| with: | |
| format: 'sarif' | |
| image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}' | |
| output: 'trivy-image-results.sarif' | |
| severity: 'CRITICAL,HIGH' | |
| # https://github.com/github/codeql-action/blob/main/upload-sarif/action.yml | |
| - name: Upload Trivy scan results | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: '.' |