Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/devin-pr-reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Request Devin session creator review

on:
pull_request:
types: [opened, reopened, ready_for_review]

permissions:
pull-requests: write

jobs:
request-review:
if: github.event.pull_request.user.login == 'devin-ai-integration[bot]'
runs-on: ubuntu-latest
steps:
- name: Request review from the session creator
uses: actions/github-script@v7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 security Mutable write-enabled action reference

The workflow loads actions/github-script through the mutable v7 tag while granting pull-request write permission, leaving repository state exposed to unintended code when that upstream tag changes; pin the action to a full commit SHA. How this was verified: The referenced action receives the workflow's pull-requests: write permission.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/devin-pr-reviewer.yml
Line: 16

Comment:
**Mutable write-enabled action reference**

The workflow loads `actions/github-script` through the mutable `v7` tag while granting pull-request write permission, leaving repository state exposed to unintended code when that upstream tag changes; pin the action to a full commit SHA. **How this was verified:** The referenced action receives the workflow's `pull-requests: write` permission.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

with:
script: |
const pr = context.payload.pull_request
const match = (pr.body ?? "").match(/^Requested by:\s*@([A-Za-z\d](?:[A-Za-z\d]|-(?=[A-Za-z\d])){0,38})\s*$/m)
if (!match) {
core.warning("No `Requested by: @user` line in the PR body; leaving reviewers unchanged")
return
}
const reviewer = match[1]
const alreadyRequested = (pr.requested_reviewers ?? []).some(
(user) => user.login.toLowerCase() === reviewer.toLowerCase(),
)
if (alreadyRequested) {
return
}
try {
await github.rest.pulls.requestReviewers({
...context.repo,
pull_number: pr.number,
reviewers: [reviewer],
})
core.info(`Requested review from @${reviewer}`)
} catch (error) {
core.warning(`Could not request review from @${reviewer}: ${error.message}`)
}
Loading