File tree 2 files changed +35
-7
lines changed 2 files changed +35
-7
lines changed Original file line number Diff line number Diff line change 1
- name : Add helper Comment on PR creation
1
+ name : Add Comment on PR Creation
2
2
3
3
on :
4
4
pull_request :
5
5
types : [opened]
6
6
7
7
jobs :
8
- comment-on-pr :
8
+ add-comment :
9
9
runs-on : ubuntu-latest
10
+ permissions :
11
+ pull-requests : write
10
12
steps :
11
- - name : Add GitHub Comment for review app instructions
13
+ - name : Add comment
12
14
uses : actions/github-script@v7
13
15
with :
14
16
script : |
15
- github.rest.issues.createComment({
16
- issue_number: context.issue.number,
17
+ await github.rest.issues.createComment({
17
18
owner: context.repo.owner,
18
19
repo: context.repo.repo,
19
- body: "Hi 👋 To deploy a review app, please comment `/deploy-review-app`"
20
- })
20
+ issue_number: context.payload.pull_request.number,
21
+ body: [
22
+ "Hi 👋 Here are the commands available for this PR:",
23
+ "",
24
+ "- `/deploy`: Deploy your changes to a review environment",
25
+ "- `/delete-review-app`: Clean up the review environment when you're done",
26
+ "- `/help`: Show detailed information about all commands",
27
+ "",
28
+ "Use `/help` to see full documentation, including configuration options."
29
+ ].join("\n")
30
+ });
Original file line number Diff line number Diff line change 20
20
PR_NUMBER : ${{ github.event.pull_request.number || github.event.issue.number }}
21
21
22
22
jobs :
23
+ debug-trigger :
24
+ if : always()
25
+ runs-on : ubuntu-latest
26
+ steps :
27
+ - name : Debug Trigger Conditions
28
+ env :
29
+ EVENT_NAME : ${{ github.event_name }}
30
+ IS_PR : ${{ toJSON(github.event.issue.pull_request) }}
31
+ COMMENT : ${{ github.event.comment.body }}
32
+ run : |
33
+ echo "Debug information for deploy command:"
34
+ echo "Event name: $EVENT_NAME"
35
+ echo "Is PR (raw): $IS_PR"
36
+ echo "Comment body: $COMMENT"
37
+ echo "Raw event payload:"
38
+ echo '${{ toJSON(github.event) }}'
39
+
23
40
Process-Deployment-Command :
41
+ needs : debug-trigger
24
42
if : |
25
43
(github.event_name == 'pull_request') ||
26
44
(github.event_name == 'issue_comment' &&
You can’t perform that action at this time.
0 commit comments