Skip to content

Commit

Permalink
Update artifact-size-metrics.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
0marperez authored Apr 25, 2024
1 parent ba49440 commit 72947ee
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/artifact-size-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ jobs:
- name: Generate Artifact Size Metrics
run: ./gradlew artifactSizeMetrics
- name: Save Artifact Size Metrics
run: |
cd build/reports/metrics
REPOSITORY=$(echo ${{ github.repository }} | cut -d '/' -f 2)
aws s3 cp artifact-size-metrics.csv s3://${{ secrets.ARTIFACT_METRICS_BUCKET }}/$REPOSITORY-${{ github.event.release.tag_name }}-release.csv
aws s3 cp artifact-size-metrics.csv s3://${{ secrets.ARTIFACT_METRICS_BUCKET }}/$REPOSITORY-latest-release.csv
run: ./gradlew saveArtifactSizeMetrics
- name: Put Artifact Size Metrics in CloudWatch
run: ./gradlew putArtifactSizeMetricsInCloudWatch -Prelease=${{ github.event.release.tag_name }}
size-check:
Expand Down Expand Up @@ -74,18 +70,19 @@ jobs:
const response = await github.graphql(getComments)
const comments = response.repository.pullRequest.comments.nodes
for (const i in comments) {
if (comments[i].author.login == 'github-actions' && !comments[i].isMinimized && comments[i].body.startsWith('Affected Artifacts')) {
const hideComment =
`mutation {
const mutations = comments
.filter(c => c[i].author.login == 'github-actions' && !c[i].isMinimized && c[i].body.startsWith('Affected Artifacts'))
.map(c =>
const hideComment =
`mutation {
minimizeComment(input:{subjectId:"${comments[i].id}", classifier:OUTDATED}){
clientMutationId
}
}
}`
await github.graphql(hideComment)
}
}
github.graphql(hideComment)
)
await Promise.all(mutations)
const fs = require('node:fs')
const comment = fs.readFileSync('build/reports/metrics/artifact-analysis.md', 'utf8')
Expand All @@ -105,5 +102,6 @@ jobs:
cd build/reports/metrics
cat has-significant-change.txt | grep false || {
echo An artifact increased in size by more than allowed or a new artifact was created.
echo If this is expected please add the 'acknowledge-artifact-size-increase' label to this pull request.
exit 1
}

0 comments on commit 72947ee

Please sign in to comment.