feat: add github subtrigger author group #18
Workflow file for this run
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
| name: Release PR | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| release-pr: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup_environment | |
| with: | |
| trivy-enabled: true | |
| - name: Get Image Data | |
| id: get-image-data | |
| run: | | |
| { | |
| echo "registry=ghcr.io" | |
| echo "name=${{ github.repository }}-beta" | |
| echo "tag=${{ github.event.number }}-${{ github.run_id }}-${{ github.run_attempt }}" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure Docker Builder | |
| run: task configure-builder | |
| - name: Build backend images | |
| working-directory: backend | |
| env: | |
| IMAGE_REGISTRY: ${{ steps.get-image-data.outputs.registry }} | |
| IMAGE_NAME: ${{ steps.get-image-data.outputs.name }} | |
| IMAGE_TAG: ${{ steps.get-image-data.outputs.tag }} | |
| run: | | |
| task ci-image-push | |
| - name: Scan backend image | |
| id: scan | |
| uses: ovsds/run-with-output-action@v1 | |
| continue-on-error: true | |
| with: | |
| run: | | |
| IMAGE_REGISTRY="${{ steps.get-image-data.outputs.registry }}" \ | |
| IMAGE_NAME="${{ steps.get-image-data.outputs.name }}" \ | |
| IMAGE_TAG="${{ steps.get-image-data.outputs.tag }}" \ | |
| task backend:ci-image-scan | |
| - name: Report vulnerabilities | |
| uses: ovsds/create-or-update-unique-comment-action@v1 | |
| with: | |
| issue-number: ${{ github.event.number }} | |
| body: | | |
| ## Vulnerabilities found | |
| ``` | |
| ${{ steps.scan.outputs.stdout }} | |
| ``` | |
| unique-body-includes: "## Vulnerabilities found" | |
| delete: ${{ steps.scan.outputs.exit_code == 0 }} |