security(ci): disable upstream-only privileged PR review bot in storefront fork
davoodmehraban89 committed
Oct 14, 2026 at 23:35 UTC
7bcd971556f9f35b418d032847ffa3d3cfbb5a6b
1 file changed
+6
-5
.github/workflows/review-prs.yml
+6
-5
@@ -23,7 +23,7 @@ jobs:
23
# `pr_number` set it emits that single PR; otherwise it collects all open
24
# non-draft PRs for the matrix below.
25
get-open-prs:
26
- if: github.event_name == 'workflow_dispatch'
26
+ if: github.repository == 'medusajs/medusa' && github.event_name == 'workflow_dispatch'
27
runs-on: ubuntu-latest
28
permissions:
29
pull-requests: read
@@ -63,7 +63,7 @@ jobs:
63
# Runs on workflow_dispatch: reviews every open non-draft PR (team members included)
64
review-all:
65
needs: get-open-prs
66
- if: needs.get-open-prs.outputs.matrix != '[]' && needs.get-open-prs.outputs.matrix != ''
66
+ if: github.repository == 'medusajs/medusa' && needs.get-open-prs.outputs.matrix != '[]' && needs.get-open-prs.outputs.matrix != ''
67
strategy:
68
matrix:
69
pr: ${{ fromJson(needs.get-open-prs.outputs.matrix) }}
@@ -82,12 +82,13 @@ jobs:
82
# Runs on pull_request_target and issue_comment (@medusajs-bot review) events: determines PR number
83
prepare:
84
if: |
85
- (github.event_name == 'pull_request_target' &&
85
+ github.repository == 'medusajs/medusa' &&
86
+ ((github.event_name == 'pull_request_target' &&
87
github.event.pull_request.draft == false &&
88
github.event.pull_request.user.login != 'github-actions[bot]') ||
89
(github.event_name == 'issue_comment' &&
90
github.event.issue.pull_request.url != '' &&
90
- contains(github.event.comment.body, '@medusajs-bot review'))
91
+ contains(github.event.comment.body, '@medusajs-bot review')))
92
runs-on: ubuntu-latest
93
outputs:
94
pr_number: ${{ steps.set.outputs.pr_number }}
@@ -147,7 +148,7 @@ jobs:
148
# Runs on pull_request_target and issue_comment: calls the reusable review workflow
149
review:
150
needs: prepare
150
- if: needs.prepare.result == 'success' && needs.prepare.outputs.should_review == 'true'
151
+ if: github.repository == 'medusajs/medusa' && needs.prepare.result == 'success' && needs.prepare.outputs.should_review == 'true'
152
uses: ./.github/workflows/review-pr-action.yml
153
with:
154
pr_number: ${{ needs.prepare.outputs.pr_number }}