99
1010jobs :
1111 generate_docs_new_pr :
12- if : ${{ contains(github.event.pull_request.labels.*.name, 'generate_go_docs') }}
12+ if : ${{ contains(github.event.pull_request.labels.*.name, 'generate_go_docs') }}
1313 runs-on : ubuntu-latest
1414 environment : integration
1515 permissions :
1616 id-token : write
17- contents : read
17+ contents : read
1818
1919 steps :
2020 - name : Setup GitHub Token for reading Generate Go Doc Repo
@@ -56,18 +56,38 @@ jobs:
5656 - 'k8s-test-runner/**/*.go'
5757 framework:
5858 - 'framework/**/*.go'
59+ tools/asciitable:
60+ - 'tools/asciitable/**/*.go'
61+ tools/breakingchanges:
62+ - 'tools/breakingchanges/**/*.go'
63+ tools/citool:
64+ - 'tools/citool/**/*.go'
65+ tools/ecrimagefetcher:
66+ - 'tools/ecrimagefetcher/**/*.go'
67+ tools/envresolve:
68+ - 'tools/envresolve/**/*.go'
5969 tools/flakeguard:
60- - 'tools/flakeguard/**/*.go'
61- # later add tools here or, if possible, make this filter dynamic so that it's created based on the go modules in the repository
70+ - 'tools/flakeguard/**/*.go'
71+ tools/ghlatestreleasechecker:
72+ - 'tools/ghlatestreleasechecker/**/*.go'
73+ tools/ghsecrets:
74+ - 'tools/ghsecrets/**/*.go'
75+ tools/gotestloghelper:
76+ - 'tools/gotestloghelper/**/*.go'
77+ tools/testlistgenerator:
78+ - 'tools/testlistgenerator/**/*.go'
79+ tools/workflowresultparser:
80+ - 'tools/workflowresultparser/**/*.go'
81+ # add more projects here
6282
6383 - name : Find all go modules in the repository and filter the ones that changed
6484 shell : bash
6585 id : go-modules
6686 env :
67- FILTERS : ${{ steps.changes.outputs.changes }}
87+ FILTERS : ${{ steps.changes.outputs.changes }}
6888 run : |
6989 PATH=$PATH:$(go env GOPATH)/bin
70- export PATH
90+ export PATH
7191
7292 # Find all go projects
7393 gomods_output=$(gomods 2>&1)
@@ -117,7 +137,7 @@ jobs:
117137 with :
118138 aws-role-arn : ${{ secrets.AWS_ROLE_ARN_CREATE_PR }}
119139 aws-lambda-url : ${{ secrets.GATI_LAMBDA_TT_URL }}
120- aws-region : ${{ secrets.AWS_REGION }}
140+ aws-region : ${{ secrets.AWS_REGION }}
121141
122142 - name : Create a new PR targeting current PR
123143 uses : peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
@@ -137,19 +157,34 @@ jobs:
137157 issue-number : ${{ github.event.pull_request.number }}
138158 body-includes : Go doc generation
139159
140- - name : Create comment in the original PR
160+ - name : Create comment in the original PR with link to the new PR
141161 uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
142- if : steps.fc .outputs.comment-id == 0
162+ if : steps.create-pr .outputs.pull-request-number != github.event.pull_request.number
143163 with :
144164 token : ${{ steps.setup-github-token-write.outputs.access-token }}
145165 issue-number : ${{ github.event.pull_request.number }}
166+ comment-id : ${{ steps.fc.outputs.comment-id }}
167+ edit-mode : replace
146168 body : |
147169 ## Go doc generation
148170 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.
149171
172+
173+ - name : Create comment in the original PR to notify about no new docs
174+ uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
175+ if : steps.create-pr.outputs.pull-request-number == github.event.pull_request.number
176+ with :
177+ token : ${{ steps.setup-github-token-write.outputs.access-token }}
178+ issue-number : ${{ github.event.pull_request.number }}
179+ comment-id : ${{ steps.fc.outputs.comment-id }}
180+ edit-mode : replace
181+ body : |
182+ ## Go doc generation
183+ Hey @${{ github.actor }}, no documentation was generated. Are you sure that you made changes to public functions without existing comments in your PR?
184+
150185 - name : Send Slack notification
151186 uses : slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
152- if : failure()
187+ if : failure()
153188 id : slack
154189 env :
155190 SLACK_BOT_TOKEN : ${{ secrets.QA_SLACK_API_KEY }}
@@ -174,7 +209,7 @@ jobs:
174209 "type": "mrkdwn",
175210 "text": "<@U060CGGPY8H>, please have a look."
176211 }
177- },
212+ },
178213 {
179214 "type": "section",
180215 "text": {
0 commit comments