From 2d2841e20dfe9f53c3d71a70ad667aa06a454e77 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Tue, 5 Aug 2025 14:53:55 +0530 Subject: [PATCH] [ty] Fix typing repository commit output in CI (#19754) ## Summary This PR fixes the issue mentioned in https://github.com/astral-sh/ruff/pull/19736#issuecomment-3151903662 ~~but I can't test it without merging it on `main` because GitHub Actions still pickup the old version of the workflow file.~~ and is tested by manually triggering the workflow, refer to the comment on this PR (https://github.com/astral-sh/ruff/pull/19754#issuecomment-3153894179) which has the commit hash. --- .../workflows/typing_conformance_comment.yaml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/typing_conformance_comment.yaml b/.github/workflows/typing_conformance_comment.yaml index 359fb387e9..f596507448 100644 --- a/.github/workflows/typing_conformance_comment.yaml +++ b/.github/workflows/typing_conformance_comment.yaml @@ -40,14 +40,6 @@ jobs: if_no_artifact_found: ignore allow_forks: true - - name: Parse conformance suite commit - id: conformance-suite-commit - run: | - if [[ -f conformance-suite-commit ]] - then - echo "CONFORMANCE_SUITE_COMMIT=$(> "$GITHUB_OUTPUT" - fi - - uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8 name: "Download typing_conformance results" id: download-typing_conformance_diff @@ -77,7 +69,14 @@ jobs: # subsequent runs echo '' >> comment.txt - echo "## Diagnostic diff on [typing conformance tests](https://github.com/python/typing/tree/${CONFORMANCE_SUITE_COMMIT}/conformance)" >> comment.txt + if [[ -f conformance-suite-commit ]] + then + echo "## Diagnostic diff on [typing conformance tests](https://github.com/python/typing/tree/$(> comment.txt + else + echo "conformance-suite-commit file not found" + echo "## Diagnostic diff on typing conformance tests" >> comment.txt + fi + if [ -s "pr/typing_conformance_diagnostics_diff/typing_conformance_diagnostics.diff" ]; then echo '
' >> comment.txt echo 'Changes were detected when running ty on typing conformance tests' >> comment.txt