Skip to content

Commit

Permalink
Limit AAb / Apk difference comments (if no changes found)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rd4dev authored Sep 6, 2024
1 parent 4730edb commit 25677cf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,32 @@ jobs:
beta $(pwd)/oppia_beta_without_changes.aab $(pwd)/oppia_beta_with_changes.aab \
ga $(pwd)/oppia_ga_without_changes.aab $(pwd)/oppia_ga_with_changes.aab
- name: Download previous build summary
uses: actions/download-artifact@v4
with:
name: brief_build_summary_${{ matrix.prInfo.number }}.log
continue-on-error: true # Ignore errors if the file doesn't exist (first run)

- name: Compare current build summary with the previous one
id: build-comparison
run: |
if [ -f brief_build_summary_${{ matrix.prInfo.number }}.log ]; then
echo "Comparing current and previous build summaries..."
if diff brief_build_summary.log brief_build_summary_${{ matrix.prInfo.number }}.log > /dev/null; then
echo "No significant changes detected; skipping comment."
exit 0
else
echo "Changes detected; proceeding with the comment."
fi
else
echo "No previous summary found; proceeding with the comment."
- name: Upload current build summary for future comparison
uses: actions/upload-artifact@v4
with:
name: brief_build_summary_${{ matrix.prInfo.number }}.log
path: brief_build_summary.log

# Reference: https://github.com/peter-evans/create-or-update-comment#setting-the-comment-body-from-a-file.
# Also, for multi-line env values, see: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings.
- name: Extract reports for uploading & commenting
Expand All @@ -203,13 +229,15 @@ jobs:
cp "$GITHUB_WORKSPACE/develop/full_build_summary.log" "$FULL_BUILD_SUMMARY_FILE_PATH"
- name: Add build stats summary comment
if: ${{ steps.build-comparison.outcome == 'success' }}
env:
PR_NUMBER: ${{ matrix.prInfo.number }}
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ env.PR_NUMBER }}
body: ${{ steps.compute-comment-body.outputs.comment_body }}

# might be removed if found redundant
- uses: actions/upload-artifact@v2
with:
name: ${{ env.FULL_BUILD_SUMMARY_FILE_NAME }}
Expand Down

0 comments on commit 25677cf

Please sign in to comment.