Skip to content

Commit 85e534a

Browse files
committed
Comment on fork review app deploy rejection
1 parent dbcb1c8 commit 85e534a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/cpflow-deploy-review-app.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ jobs:
157157
echo "Review app deploys from fork pull requests are not allowed for workflow_dispatch because this workflow uses repository secrets." >&2
158158
exit 1
159159
160+
- name: Comment on fork PR deploy rejection
161+
if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'false' && github.event_name == 'issue_comment'
162+
uses: actions/github-script@v7
163+
with:
164+
script: |
165+
await github.rest.issues.createComment({
166+
owner: context.repo.owner,
167+
repo: context.repo.repo,
168+
issue_number: Number(process.env.PR_NUMBER),
169+
body: `Review app deploys from fork pull requests require a branch in ${process.env.GITHUB_REPOSITORY}.\n\nThis workflow builds Docker images with repository secrets, so comment-triggered deploys only run for branches in the base repository.`
170+
});
171+
160172
- name: Checkout PR commit
161173
if: steps.config.outputs.ready == 'true' && steps.source.outputs.allowed == 'true'
162174
uses: actions/checkout@v4

0 commit comments

Comments
 (0)