Secure/5.15.0-r6 #1
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: Promote Security Image | |
| on: | |
| pull_request_review: | |
| types: [submitted] | |
| jobs: | |
| extract-image-tag: | |
| name: Extract image tag from PR title | |
| if: >- | |
| github.event.review.state == 'approved' && | |
| startsWith(github.event.pull_request.head.ref, 'secure/') && | |
| (github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'main') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| image-tag: ${{ steps.extract.outputs.image-tag }} | |
| steps: | |
| - name: Extract image tag from PR title | |
| id: extract | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| NORM=$(echo "${PR_TITLE}" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)[[:space:]]+[rR]([0-9]+)/\1-r\2/g') | |
| IMAGE_TAG=$(echo "${NORM}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+-r[0-9]+' | tail -1) | |
| if [ -z "${IMAGE_TAG}" ]; then | |
| echo "::error::Could not extract a version tag (x.x.x-rN or x.x.x rN) from PR title: '${PR_TITLE}'" | |
| exit 1 | |
| fi | |
| echo "image-tag=${IMAGE_TAG}" >> "$GITHUB_OUTPUT" | |
| echo "Extracted image tag: ${IMAGE_TAG}" | |
| promote-to-gcr: | |
| name: Promote ${{ github.event.repository.name }} to GCP Artifact Registry | |
| needs: extract-image-tag | |
| uses: reportportal/.github/.github/workflows/promote-ecr-to-gcr.yaml@main | |
| with: | |
| service: ${{ github.event.repository.name }} | |
| image-tag: ${{ needs.extract-image-tag.outputs.image-tag }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| secrets: | |
| AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }} | |
| GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
| GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
| GCR_REGION: ${{ secrets.GCR_REGION }} | |
| GCP_PROJECT: ${{ secrets.GCP_PROJECT }} |