diff --git a/.github/workflows/regression-report.yml b/.github/workflows/regression-report.yml index 651c29088f4..5d6725e1d70 100644 --- a/.github/workflows/regression-report.yml +++ b/.github/workflows/regression-report.yml @@ -20,6 +20,9 @@ env: on: issue_comment: types: [ created ] + pull_request: + types: + - opened permissions: contents: read @@ -56,9 +59,6 @@ jobs: content: 'rocket' }) - - run: 'echo We print it here for this action to work' - if: 'true' - - name: Checkout repository uses: actions/checkout@v4 @@ -115,18 +115,23 @@ jobs: || needs.parse_comment.outputs.projects_link != '' outputs: message: ${{ steps.out.outputs.message }} + download_files_failed: ${{ steps.download_files.outputs.failed }} steps: - name: Download checkstyle uses: actions/checkout@v4 - name: Download files + id: download_files env: DIFF_CONFIG_LINK: ${{ needs.parse_comment.outputs.config_link }} DIFF_PROJECTS_LINK: ${{ needs.parse_comment.outputs.projects_link }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./.ci/diff-report.sh download-files + if ! ./.ci/diff-report.sh download-files; then + ./.ci/append-to-github-output.sh "failed" "true" + exit 1 + fi # set main checkstyle repo as an upstream # Diff report will be generated taking upstream's master branch as a base branch @@ -219,11 +224,15 @@ jobs: - name: Get message env: MSG: ${{ needs.make_report.outputs.message }} + DOWNLOAD_FAILED: ${{ needs.make_report.outputs.download_files_failed }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p .ci-temp - if [ -z "$MSG" ]; then - JOBS_LINK="https://github.com/checkstyle/checkstyle/actions/runs/${{github.run_id}}" + JOBS_LINK="https://github.com/checkstyle/checkstyle/actions/runs/${{github.run_id}}" + if [ "$DOWNLOAD_FAILED" == "true" ]; then + echo "Report generation failed. Please use 'GitHub, generate report for" \ + "check_name/example_type'
Link: $JOBS_LINK" > .ci-temp/message + elif [ -z "$MSG" ]; then API_LINK="https://api.github.com/repos/checkstyle/checkstyle/actions/runs/" API_LINK="${API_LINK}${{github.run_id}}/jobs"