Skip to content

Commit 04ccf6c

Browse files
zaniebzaniebot
andauthored
[ty] Publish memory reports from GitHub Actions (astral-sh#29607)
Memory report comments currently depend on `astral-sh-bot`. Publish the memory diff artifact as `astral-automations-bot[bot]` after the memory report job, using the shared STS publisher and comment IDs from the key-value store. This handles same-repository pull requests, including runs that upload a report before failing. Depends on astral-sh#29606. --------- Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
1 parent 81616db commit 04ccf6c

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

‎.github/workflows/memory_report.yaml‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,27 @@ jobs:
124124
--output ../memory_report_diff.diff
125125
)
126126
127-
# NOTE: astral-sh-bot uses this artifact to post comments on PRs.
128-
# Make sure to update the bot if you rename the artifact.
129127
- name: Upload diff
130128
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
131129
with:
132130
name: memory_report_diff
133131
path: memory_report_diff.diff
132+
133+
publish-report:
134+
needs: memory_report
135+
if: >-
136+
!cancelled() && github.event_name == 'pull_request' &&
137+
github.repository == 'astral-sh/ruff' &&
138+
github.event.pull_request.head.repo.full_name == github.repository &&
139+
(needs.memory_report.result == 'success' || needs.memory_report.result == 'failure')
140+
uses: astral-sh/ruff/.github/workflows/publish-pull-request-report.yml@main # zizmor: ignore[unpinned-uses]
141+
secrets:
142+
KV_API_URL: ${{ secrets.KV_API_URL }}
143+
STS_API_URL: ${{ secrets.STS_API_URL }}
144+
permissions:
145+
contents: read
146+
id-token: write
147+
with:
148+
report: memory
149+
artifact: memory_report_diff
150+
filename: memory_report_diff.diff

0 commit comments

Comments
 (0)