build(deps): bump pillow from 11.1.0 to 12.1.1 in /src/ai-service #216
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: test-e2e-pr | |
| on: | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| check-permissions: | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, '/test-e2e') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has-permission: ${{ steps.check.outputs.has-permission }} | |
| pr-number: ${{ steps.get-pr.outputs.pr-number }} | |
| steps: | |
| - name: Check if user has permission | |
| id: check | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 | |
| with: | |
| script: | | |
| const { data: collaborator } = await github.rest.repos.getCollaboratorPermissionLevel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| username: context.actor | |
| }); | |
| const hasPermission = ['admin', 'maintain'].includes(collaborator.permission); | |
| console.log(`User ${context.actor} has permission: ${collaborator.permission}`); | |
| console.log(`Has required permission: ${hasPermission}`); | |
| core.setOutput('has-permission', hasPermission); | |
| if (!hasPermission) { | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `❌ @${context.actor} You don't have permission to run this command. Only repository owners and maintainers can trigger this workflow.` | |
| }); | |
| } | |
| - name: Get PR number | |
| id: get-pr | |
| if: steps.check.outputs.has-permission == 'true' | |
| run: echo "pr-number=${PR_URL##*/}" >> "$GITHUB_OUTPUT" | |
| env: | |
| PR_URL: ${{ github.event.issue.pull_request.url }} | |
| start-comment: | |
| needs: check-permissions | |
| if: needs.check-permissions.outputs.has-permission == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add status comment - Starting | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `🚀 @${context.actor} Starting E2E tests... | |
| **Workflow Run:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
| **Environment:** ${{ vars.AZURE_ENV_NAME }} | |
| **Location:** ${{ vars.AZURE_LOCATION }}` | |
| }); | |
| test-e2e: | |
| needs: [check-permissions, start-comment] | |
| if: needs.check-permissions.outputs.has-permission == 'true' | |
| uses: ./.github/workflows/test-e2e-reusable.yaml | |
| secrets: inherit | |
| with: | |
| deploy-from-source: true | |
| deploy-method: kustomize | |
| deploy-full-services: true | |
| pr-number: ${{ needs.check-permissions.outputs.pr-number }} | |
| result-comment: | |
| needs: [check-permissions, test-e2e] | |
| if: always() && needs.check-permissions.outputs.has-permission == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add status comment - Success | |
| if: needs.test-e2e.result == 'success' | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 | |
| with: | |
| script: | | |
| const startTime = new Date('${{ github.event.comment.created_at }}'); | |
| const endTime = new Date(); | |
| const duration = Math.round((endTime - startTime) / 1000 / 60); // minutes | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `✅ @${context.actor} E2E tests completed successfully! | |
| **Workflow Run:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
| **Duration:** ~${duration} minutes | |
| **Status:** Passed | |
| **Environment:** ${{ vars.AZURE_ENV_NAME }} | |
| **Location:** ${{ vars.AZURE_LOCATION }} | |
| All tests passed and resources have been cleaned up.` | |
| }); | |
| - name: Add status comment - Failure | |
| if: needs.test-e2e.result == 'failure' | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `❌ @${context.actor} E2E tests failed! | |
| **Workflow Run:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
| **Status:** Failed | |
| **Environment:** ${{ vars.AZURE_ENV_NAME }} | |
| **Location:** ${{ vars.AZURE_LOCATION }} | |
| Please check the workflow logs for details and try again.` | |
| }); |