From a125e51e8c97a8e4027bb04cbb8058750da938c0 Mon Sep 17 00:00:00 2001 From: Manas <119405883+manas-yu@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:34:57 +0530 Subject: [PATCH] Fix #5566: Handle action_required status in code coverage (#5574) ## Explanation Fixes #5566: This PR addresses the issue of code coverage comments not being posted on pull requests when certain review status ("Request Changes") result in an `action_required` status. ### Changes: - Updated `comment_coverage.yml` to include `action_required` in the `allowed-conclusions` list for the `check_code_coverage_completed` job. This ensures that the workflow continues even if a review requires further action. ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). --- .github/workflows/comment_coverage_report.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/comment_coverage_report.yml b/.github/workflows/comment_coverage_report.yml index 16c1ae0da63..0cc70da29a2 100644 --- a/.github/workflows/comment_coverage_report.yml +++ b/.github/workflows/comment_coverage_report.yml @@ -17,6 +17,8 @@ jobs: check_code_coverage_completed: name: Check code coverage completed runs-on: ubuntu-latest + outputs: + conclusion: ${{ steps.wait-for-coverage.outputs.run-conclusion }} steps: - name: Wait for code coverage to complete id: wait-for-coverage @@ -27,6 +29,13 @@ jobs: allowed-conclusions: | success failure + action_required + + - name: Conclusion Analysis + if: steps.wait-for-coverage.outputs.run-conclusion == 'action_required' + run: | + echo "::error::First-time contributor workflows require manual approval. After approval, please re-run the comment coverage workflows to post the coverage report." + exit 1 comment_coverage_report: name: Comment Code Coverage Report @@ -60,7 +69,7 @@ jobs: const run = runs[0]; if(!run) { - core.setFailed('Could not find a succesful workflow run for the PR'); + core.setFailed('Could not find a successful workflow run for the PR'); return; }