diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index a7d77d0ec8c4b..934ad21b6ad1e 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -1,4 +1,4 @@ -name: PR Check Comment +name: Ecosystem check comment on: workflow_run: @@ -18,13 +18,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: dawidd6/action-download-artifact@v2 - name: Download PR Number + name: Download pull request number with: name: pr-number run_id: ${{ github.event.workflow_run.id || github.event.inputs.workflow_run_id }} if_no_artifact_found: ignore - - name: Extract PR Number + - name: Parse pull request number id: pr-number run: | if [[ -f pr-number ]] @@ -33,7 +33,7 @@ jobs: fi - uses: dawidd6/action-download-artifact@v2 - name: "Download Ecosystem Result" + name: "Download ecosystem results" id: download-ecosystem-result if: steps.pr-number.outputs.pr-number with: @@ -44,10 +44,14 @@ jobs: workflow_conclusion: completed if_no_artifact_found: ignore - - name: Generate Comment + - name: Generate comment content id: generate-comment if: steps.download-ecosystem-result.outputs.found_artifact == 'true' run: | + # Note this identifier is used to find the comment to update on + # subsequent runs + echo '' >> comment.txt + echo '## `ruff-ecosystem` results' >> comment.txt cat pr/ecosystem/ecosystem-result >> comment.txt echo "" >> comment.txt @@ -56,14 +60,14 @@ jobs: cat comment.txt >> $GITHUB_OUTPUT echo 'EOF' >> $GITHUB_OUTPUT - - name: Find Comment + - name: Find existing comment uses: peter-evans/find-comment@v2 if: steps.generate-comment.outcome == 'success' id: find-comment with: issue-number: ${{ steps.pr-number.outputs.pr-number }} comment-author: "github-actions[bot]" - body-includes: PR Check Results + body-includes: "" - name: Create or update comment if: steps.find-comment.outcome == 'success'