@@ -22,7 +22,7 @@ gitGraph
2222 merge main
2323```
2424
25- ---
25+ ## Sequence Diagram: Adhoc Commands Workflow
2626
2727``` mermaid
2828sequenceDiagram
@@ -63,7 +63,26 @@ sequenceDiagram
6363
6464```
6565
66- ## Usage
66+ ### 1. Main Branch to New Branch: Checkout and Changes
67+
68+ - The main branch initiates the creation of a new branch.
69+ - The user makes changes in the new branch, commits them, and pushes the changes to the remote repository.
70+
71+ ### 2. New Branch to Main Branch: Create Pull Request
72+
73+ - A pull request is created from the new branch to the main branch.
74+
75+ ### 3. User to Pull Request: Trigger Commands
76+
77+ - The user adds a comment to the pull request with one of the following commands: ` /rebase ` , ` /autosquash ` , or ` /rebase-autosquash ` .
78+
79+ ### 4. Based on Comment: Rebase, Autosquash, or Both
80+
81+ - If the comment contains ` /rebase ` , the main branch rebases onto the new branch.
82+ - If the comment contains ` /autosquash ` , autosquashing is performed in the new branch.
83+ - If the comment contains ` /rebase-autosquash ` , both rebase and autosquash actions are executed.
84+
85+ # Usage
6786
6887### Workflow Setup
6988
@@ -100,7 +119,7 @@ jobs:
100119 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
101120` ` `
102121
103- ## Sequence Diagram: Adhoc Commands Workflow
122+ ## Github Action Adhoc Commands Workflow
104123
105124` ` ` mermaid
106125 sequenceDiagram
@@ -125,21 +144,35 @@ jobs:
125144
126145```
127146
128- ### 1. Main Branch to New Branch: Checkout and Changes
147+ ## Sequence Diagram: GitHub Actions Workflow
129148
130- - The main branch initiates the creation of a new branch.
131- - The user makes changes in the new branch, commits them, and pushes the changes to the remote repository.
149+ ### 1. User to GitHub Event: Trigger PR Comment
132150
133- ### 2. New Branch to Main Branch: Create Pull Request
151+ - The user creates a pull request comment with one of the commands: ` /rebase ` , ` /autosquash ` , or ` /rebase-autosquash ` .
134152
135- - A pull request is created from the new branch to the main branch.
153+ ### 2. GitHub Event to GitHub Actions: Event Trigger
136154
137- ### 3. User to Pull Request: Trigger Commands
155+ - The GitHub event is triggered, specifically the 'created' event on ` issue_comment ` .
138156
139- - The user adds a comment to the pull request with one of the following commands: ` /rebase ` , ` /autosquash ` , or ` /rebase-autosquash ` .
157+ ### 3. GitHub Actions to Checkout Action: Prepare Workflow
140158
141- ### 4. Based on Comment: Rebase, Autosquash, or Both
159+ - GitHub Actions checks if the pull request comment contains specific commands.
160+ - If commands are found, it proceeds to the next step; otherwise, the workflow is ignored.
142161
143- - If the comment contains ` /rebase ` , the main branch rebases onto the new branch.
144- - If the comment contains ` /autosquash ` , autosquashing is performed in the new branch.
145- - If the comment contains ` /rebase-autosquash ` , both rebase and autosquash actions are executed.
162+ ### 4. Checkout Action to Adhoc Commands Action: Execute Commands
163+
164+ - GitHub Actions checks out the latest code.
165+ - Adhoc Commands Action is triggered to run ad-hoc commands based on the user's comment.
166+
167+ ### 5. Adhoc Commands Action to GitHub Actions: Successful Execution
168+
169+ - Adhoc commands are executed successfully, performing actions such as rebase, autosquash, or both.
170+ - GitHub Actions acknowledges the successful execution.
171+
172+ ### 6. GitHub Actions to GitHub Event: Complete Workflow
173+
174+ - The workflow is completed, and GitHub Actions updates the GitHub event accordingly.
175+
176+ ### 7. GitHub Actions to GitHub Event: Ignore Workflow
177+
178+ - If no specific commands are found in the PR comment, GitHub Actions ignores the workflow.
0 commit comments