Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit AAb / Apk difference comments (if no changes found) #12

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading