diff --git a/.github/workflows/artifact-size-metrics.yml b/.github/workflows/artifact-size-metrics.yml index d1216099ae..d690d87916 100644 --- a/.github/workflows/artifact-size-metrics.yml +++ b/.github/workflows/artifact-size-metrics.yml @@ -62,56 +62,9 @@ jobs: run: ./gradlew artifactSizeMetrics - name: Analyze Artifact Size Metrics run: ./gradlew analyzeArtifactSizeMetrics - - name: Show Results - uses: actions/github-script@v7 - with: - script: | - const getComments = - `query { - repository(owner:"${context.repo.owner}", name:"${context.repo.repo}"){ - pullRequest(number: ${context.issue.number}) { - id - comments(last:100) { - nodes { - id - body - author { - login - } - isMinimized - } - } - } - } - }` - - const response = await github.graphql(getComments) - const comments = response.repository.pullRequest.comments.nodes - - const mutations = comments - .filter(comment => comment.author.login == 'github-actions' && !comment.isMinimized && comment.body.startsWith('Affected Artifacts')) - .map(comment => - github.graphql( - `mutation { - minimizeComment(input:{subjectId:"${comment.id}", classifier:OUTDATED}){ - clientMutationId - } - }` - ) - ) - await Promise.all(mutations) - const fs = require('node:fs') - const comment = fs.readFileSync('build/reports/metrics/artifact-analysis.md', 'utf8') - - const writeComment = - `mutation { - addComment(input:{body:"""${comment}""", subjectId:"${response.repository.pullRequest.id}"}){ - clientMutationId - } - }` - - await github.graphql(writeComment) + - name: Show Results + uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/show-results@main - name: Evaluate if: ${{ !contains(github.event.pull_request.labels.*.name, 'acknowledge-artifact-size-increase') }}