File tree Expand file tree Collapse file tree 2 files changed +35
-7
lines changed Expand file tree Collapse file tree 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
22
33on :
44 pull_request :
55 types : [opened]
66
77jobs :
8- comment-on-pr :
8+ add-comment :
99 runs-on : ubuntu-latest
10+ permissions :
11+ pull-requests : write
1012 steps :
11- - name : Add GitHub Comment for review app instructions
13+ - name : Add comment
1214 uses : actions/github-script@v7
1315 with :
1416 script : |
15- github.rest.issues.createComment({
16- issue_number: context.issue.number,
17+ await github.rest.issues.createComment({
1718 owner: context.repo.owner,
1819 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 2020 PR_NUMBER : ${{ github.event.pull_request.number || github.event.issue.number }}
2121
2222jobs :
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+
2340 Process-Deployment-Command :
41+ needs : debug-trigger
2442 if : |
2543 (github.event_name == 'pull_request') ||
2644 (github.event_name == 'issue_comment' &&
You can’t perform that action at this time.
0 commit comments