Skip to content

Commit

Permalink
Issue checkstyle#15394: Refactor new Github Workflow: regression-repo…
Browse files Browse the repository at this point in the history
…rt.yml
  • Loading branch information
piyush kumar sadangi authored and romani committed Jul 28, 2024
1 parent db78177 commit a0460ba
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/regression-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ env:
on:
issue_comment:
types: [ created ]
pull_request:
types:
- opened

permissions:
contents: read
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'<br>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"
Expand Down

0 comments on commit a0460ba

Please sign in to comment.