From 0f0ea69600d880cf0017584f42b575d4acc75607 Mon Sep 17 00:00:00 2001 From: Nick James Kirkby <20824939+driftregion@users.noreply.github.com> Date: Sat, 25 Jan 2025 22:47:34 -0700 Subject: [PATCH] be sure to pass head.sha --- .CodeChecker/post_to_github.py | 4 ++-- .github/workflows/static_analysis.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.CodeChecker/post_to_github.py b/.CodeChecker/post_to_github.py index 857c989..9919ca7 100644 --- a/.CodeChecker/post_to_github.py +++ b/.CodeChecker/post_to_github.py @@ -21,9 +21,9 @@ def main(report_path): print("Error: GITHUB_REPOSITORY not found in environment.") sys.exit(1) - head_sha = os.environ.get("GITHUB_SHA") + head_sha = os.environ.get("GITHUB_HEAD_SHA") if not head_sha: - print("Error: GITHUB_SHA not found in environment.") + print("Error: GITHUB_HEAD_SHA not found in environment.") sys.exit(1) owner, repo = repository.split("/") diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index d098ee6..67f6920 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -40,7 +40,8 @@ jobs: - name: Create Check Run with Annotations env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_SHA: ${{ github.event.pull_request.head.sha }} + GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }} GITHUB_REPOSITORY: ${{ github.repository }} run: | + echo "PR HEAD is ${{ github.event.pull_request.head.sha }}" python3 .CodeChecker/post_to_github.py report.json \ No newline at end of file