Skip to content

Commit 1c9eb82

Browse files
authored
[TT-1725] improve go doc pipeline (#1452)
1 parent 43b2b05 commit 1c9eb82

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/generate-go-docs.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ jobs:
9494
cat filtered_folders.json | jq -c '.[]' | while read -r item; do
9595
folder=$(echo "$item" | jq -r '.folder')
9696
echo "Processing folder: $folder"
97-
generate-go-function-docs diff -b ${{ github.event.pull_request.base.sha }} -c ${{ github.event.pull_request.head.sha }} --saveCosts --generator chatgpt --folder "$folder"
98-
cd "$folder"
99-
cd -
97+
generate-go-function-docs diff -b ${{ github.event.pull_request.base.sha }} -c ${{ github.event.pull_request.head.sha }} --saveCosts --generator chatgpt --generatorSubType ${{ vars.GO_DOC_GEN_CHATGPT_MODEL }} --folder "$folder"
10098
done
10199
rm filtered_folders.json
102100
@@ -120,6 +118,7 @@ jobs:
120118

121119
- name: Create a new PR targeting current PR
122120
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
121+
id: create-pr
123122
with:
124123
token: ${{ steps.setup-github-token-write.outputs.access-token }}
125124
branch: ${{ github.head_ref }}-docs
@@ -128,6 +127,23 @@ jobs:
128127
body: "This PR contains automatically generated go documentation for the PR#${{ github.event.pull_request.number }}. Please review the changes."
129128
commit-message: "[Bot] Add automatically generated go documentation"
130129

130+
- name: Find comment with PR link
131+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
132+
id: fc
133+
with:
134+
issue-number: ${{ github.event.pull_request.number }}
135+
body-includes: Go doc generation
136+
137+
- name: Create comment in the original PR
138+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
139+
if: steps.fc.outputs.comment-id == 0
140+
with:
141+
token: ${{ steps.setup-github-token-write.outputs.access-token }}
142+
issue-number: ${{ github.event.pull_request.number }}
143+
body: |
144+
## Go doc generation
145+
Hey @${{ github.actor }}, you can check generated Go function documentation [here](${{ steps.create-pr.outputs.pull-request-url }}). Please review them and merge to this PR once you're satisfied with them.
146+
131147
- name: Send Slack notification
132148
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
133149
if: failure()

0 commit comments

Comments
 (0)