8585 with :
8686 role-to-assume : ${{ secrets.CI_AWS_ROLE_ARN }}
8787 aws-region : us-west-2
88+ - name : Configure Gradle
89+ uses : awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
8890 - name : Run Service Check Batch and Calculate Artifact Size Metrics
8991 id : svc-check-batch
9092 run : |
@@ -140,56 +142,9 @@ jobs:
140142 ./gradlew collectDelegatedArtifactSizeMetrics -PpullRequest=$PULL_REQUEST
141143 - name : Analyze Artifact Size Metrics
142144 run : ./gradlew analyzeArtifactSizeMetrics
143- - name : Show Results
144- uses : actions/github-script@v7
145- with :
146- script : |
147- const getComments =
148- `query {
149- repository(owner:"${context.repo.owner}", name:"${context.repo.repo}"){
150- pullRequest(number: ${context.issue.number ?? process.env.SDK_PR}) {
151- id
152- comments(last:100) {
153- nodes {
154- id
155- body
156- author {
157- login
158- }
159- isMinimized
160- }
161- }
162- }
163- }
164- }`
165-
166- const response = await github.graphql(getComments)
167- const comments = response.repository.pullRequest.comments.nodes
168-
169- const mutations = comments
170- .filter(comment => comment.author.login == 'github-actions' && !comment.isMinimized && comment.body.startsWith('Affected Artifacts'))
171- .map(comment =>
172- github.graphql(
173- `mutation {
174- minimizeComment(input:{subjectId:"${comment.id}", classifier:OUTDATED}){
175- clientMutationId
176- }
177- }`
178- )
179- )
180- await Promise.all(mutations)
181145
182- const fs = require('node:fs')
183- const comment = fs.readFileSync('build/reports/metrics/artifact-analysis.md', 'utf8')
184-
185- const writeComment =
186- `mutation {
187- addComment(input:{body:"""${comment}""", subjectId:"${response.repository.pullRequest.id}"}){
188- clientMutationId
189- }
190- }`
191-
192- await github.graphql(writeComment)
146+ - name : Show Results
147+ uses : awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/show-results@main
193148
194149 - name : Evaluate Result
195150 if : ${{ !contains(github.event.pull_request.labels.*.name, 'acknowledge-artifact-size-increase') }}
@@ -212,6 +167,8 @@ jobs:
212167 with :
213168 role-to-assume : ${{ secrets.CI_AWS_ROLE_ARN }}
214169 aws-region : us-west-2
170+ - name : Configure Gradle
171+ uses : awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
215172 - name : Calculate Artifact Size Metrics
216173 id : svc-check-batch
217174 run : |
0 commit comments