PCA init #9
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: Devin Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| inputs: | |
| pr_number: | |
| description: Pull request number to review | |
| required: true | |
| type: string | |
| jobs: | |
| devin-review: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| steps: | |
| - name: Resolve Devin Review URL | |
| id: review | |
| uses: actions/github-script@v8 | |
| env: | |
| WORKFLOW_PR_NUMBER: ${{ inputs.pr_number }} | |
| with: | |
| script: | | |
| const prNumber = context.eventName === 'workflow_dispatch' | |
| ? Number(process.env.WORKFLOW_PR_NUMBER) | |
| : context.payload.pull_request.number; | |
| if (!Number.isInteger(prNumber) || prNumber <= 0) { | |
| core.setFailed(`Invalid pull request number: ${prNumber}`); | |
| return; | |
| } | |
| const { owner, repo } = context.repo; | |
| const reviewUrl = `https://devinreview.com/${owner}/${repo}/pull/${prNumber}`; | |
| const prUrl = `https://github.com/${owner}/${repo}/pull/${prNumber}`; | |
| core.setOutput('number', String(prNumber)); | |
| core.setOutput('pr_url', prUrl); | |
| core.setOutput('review_url', reviewUrl); | |
| - name: Warm Devin Review page | |
| env: | |
| REVIEW_URL: ${{ steps.review.outputs.review_url }} | |
| run: | | |
| curl --fail --silent --show-error --location "$REVIEW_URL" --output /dev/null | |
| - name: Publish Devin Review summary | |
| env: | |
| PR_NUMBER: ${{ steps.review.outputs.number }} | |
| PR_URL: ${{ steps.review.outputs.pr_url }} | |
| REVIEW_URL: ${{ steps.review.outputs.review_url }} | |
| run: | | |
| { | |
| echo "Devin Review is available for PR #${PR_NUMBER}." | |
| echo | |
| echo "- GitHub PR: ${PR_URL}" | |
| echo "- Devin Review: ${REVIEW_URL}" | |
| echo | |
| echo "This workflow intentionally does not use DEVIN_API_KEY." | |
| echo "For automatic Devin statuses or comments inside GitHub, connect the Devin GitHub integration and enable auto-review in Devin settings." | |
| } >> "$GITHUB_STEP_SUMMARY" |