mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:21 +00:00
Fix ecosystem check bug where comment is no longer updated (#8446)
Instead, a second is posted
This commit is contained in:
parent
0d93fbb4a2
commit
7dd5137913
1 changed files with 11 additions and 7 deletions
18
.github/workflows/pr-comment.yaml
vendored
18
.github/workflows/pr-comment.yaml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: PR Check Comment
|
name: Ecosystem check comment
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
|
@ -18,13 +18,13 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dawidd6/action-download-artifact@v2
|
- uses: dawidd6/action-download-artifact@v2
|
||||||
name: Download PR Number
|
name: Download pull request number
|
||||||
with:
|
with:
|
||||||
name: pr-number
|
name: pr-number
|
||||||
run_id: ${{ github.event.workflow_run.id || github.event.inputs.workflow_run_id }}
|
run_id: ${{ github.event.workflow_run.id || github.event.inputs.workflow_run_id }}
|
||||||
if_no_artifact_found: ignore
|
if_no_artifact_found: ignore
|
||||||
|
|
||||||
- name: Extract PR Number
|
- name: Parse pull request number
|
||||||
id: pr-number
|
id: pr-number
|
||||||
run: |
|
run: |
|
||||||
if [[ -f pr-number ]]
|
if [[ -f pr-number ]]
|
||||||
|
@ -33,7 +33,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- uses: dawidd6/action-download-artifact@v2
|
- uses: dawidd6/action-download-artifact@v2
|
||||||
name: "Download Ecosystem Result"
|
name: "Download ecosystem results"
|
||||||
id: download-ecosystem-result
|
id: download-ecosystem-result
|
||||||
if: steps.pr-number.outputs.pr-number
|
if: steps.pr-number.outputs.pr-number
|
||||||
with:
|
with:
|
||||||
|
@ -44,10 +44,14 @@ jobs:
|
||||||
workflow_conclusion: completed
|
workflow_conclusion: completed
|
||||||
if_no_artifact_found: ignore
|
if_no_artifact_found: ignore
|
||||||
|
|
||||||
- name: Generate Comment
|
- name: Generate comment content
|
||||||
id: generate-comment
|
id: generate-comment
|
||||||
if: steps.download-ecosystem-result.outputs.found_artifact == 'true'
|
if: steps.download-ecosystem-result.outputs.found_artifact == 'true'
|
||||||
run: |
|
run: |
|
||||||
|
# Note this identifier is used to find the comment to update on
|
||||||
|
# subsequent runs
|
||||||
|
echo '<!-- generated-comment ecosystem -->' >> comment.txt
|
||||||
|
|
||||||
echo '## `ruff-ecosystem` results' >> comment.txt
|
echo '## `ruff-ecosystem` results' >> comment.txt
|
||||||
cat pr/ecosystem/ecosystem-result >> comment.txt
|
cat pr/ecosystem/ecosystem-result >> comment.txt
|
||||||
echo "" >> comment.txt
|
echo "" >> comment.txt
|
||||||
|
@ -56,14 +60,14 @@ jobs:
|
||||||
cat comment.txt >> $GITHUB_OUTPUT
|
cat comment.txt >> $GITHUB_OUTPUT
|
||||||
echo 'EOF' >> $GITHUB_OUTPUT
|
echo 'EOF' >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Find Comment
|
- name: Find existing comment
|
||||||
uses: peter-evans/find-comment@v2
|
uses: peter-evans/find-comment@v2
|
||||||
if: steps.generate-comment.outcome == 'success'
|
if: steps.generate-comment.outcome == 'success'
|
||||||
id: find-comment
|
id: find-comment
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ steps.pr-number.outputs.pr-number }}
|
issue-number: ${{ steps.pr-number.outputs.pr-number }}
|
||||||
comment-author: "github-actions[bot]"
|
comment-author: "github-actions[bot]"
|
||||||
body-includes: PR Check Results
|
body-includes: "<!-- generated-comment ecosystem -->"
|
||||||
|
|
||||||
- name: Create or update comment
|
- name: Create or update comment
|
||||||
if: steps.find-comment.outcome == 'success'
|
if: steps.find-comment.outcome == 'success'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue