From ee6c8a599598ab6445b77a734485fa3e8dab1af0 Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Mon, 13 Feb 2023 20:39:12 +0100 Subject: [PATCH] Make Type Completeness Workflow Usable for PRs from Forks (#3551) --- .github/workflows/type_completeness.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/type_completeness.yml b/.github/workflows/type_completeness.yml index 39d6b7146..e5ef12ba3 100644 --- a/.github/workflows/type_completeness.yml +++ b/.github/workflows/type_completeness.yml @@ -23,17 +23,18 @@ jobs: - name: Install Pyright run: | python -W ignore -m pip install pyright~=1.1.291 + - name: Get PR Completeness + # Must run before base completeness, as base completeness will checkout the base branch + # And we can't go back to the PR branch after that in case the PR is coming from a fork + run: | + pip install . -U + pyright --verifytypes telegram --ignoreexternal --outputjson > pr.json || true + pyright --verifytypes telegram --ignoreexternal > pr.readable || true - name: Get Base Completeness run: | git checkout ${{ github.base_ref }} pip install . -U pyright --verifytypes telegram --ignoreexternal --outputjson > base.json || true - - name: Get PR Completeness - run: | - git checkout ${{ github.head_ref }} - pip install . -U - pyright --verifytypes telegram --ignoreexternal --outputjson > pr.json || true - pyright --verifytypes telegram --ignoreexternal > pr.readable || true - name: Compare Completeness uses: jannekem/run-python-script-action@v1 with: