Closes https://github.com/astral-sh/ruff/issues/8076 Follow-up to #8358 Doubles the amount of ecosystem checks we do, adding separate groups for the stable sections. We're likely to run into GitHub comment length restrictions if there are significant deviations. However, it should not be common for changes in stable and preview to occur at the same time, nor should it be common for linter and formatter changes to occur at the same time.
76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
name: PR Check Comment
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: [CI]
|
|
types: [completed]
|
|
workflow_dispatch:
|
|
inputs:
|
|
workflow_run_id:
|
|
description: The ecosystem workflow that triggers the workflow run
|
|
required: true
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
comment:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: dawidd6/action-download-artifact@v2
|
|
name: Download PR 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
|
|
id: pr-number
|
|
run: |
|
|
if [[ -f pr-number ]]
|
|
then
|
|
echo "pr-number=$(<pr-number)" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- uses: dawidd6/action-download-artifact@v2
|
|
name: "Download Ecosystem Result"
|
|
id: download-ecosystem-result
|
|
if: steps.pr-number.outputs.pr-number
|
|
with:
|
|
name: ecosystem-result
|
|
workflow: ci.yaml
|
|
pr: ${{ steps.pr-number.outputs.pr-number }}
|
|
path: pr/ecosystem
|
|
workflow_conclusion: completed
|
|
if_no_artifact_found: ignore
|
|
|
|
- name: Generate Comment
|
|
id: generate-comment
|
|
if: steps.download-ecosystem-result.outputs.found_artifact == 'true'
|
|
run: |
|
|
echo '## `ruff-ecosystem` results' >> comment.txt
|
|
cat pr/ecosystem/ecosystem-result >> comment.txt
|
|
echo "" >> comment.txt
|
|
|
|
echo 'comment<<EOF' >> $GITHUB_OUTPUT
|
|
cat comment.txt >> $GITHUB_OUTPUT
|
|
echo 'EOF' >> $GITHUB_OUTPUT
|
|
|
|
- name: Find 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
|
|
|
|
- name: Create or update comment
|
|
if: steps.find-comment.outcome == 'success'
|
|
uses: peter-evans/create-or-update-comment@v3
|
|
with:
|
|
comment-id: ${{ steps.find-comment.outputs.comment-id }}
|
|
issue-number: ${{ steps.pr-number.outputs.pr-number }}
|
|
body-path: comment.txt
|
|
edit-mode: replace
|