From d5217a416be89b0226ba96e74a2f981f413038c2 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Thu, 13 Jun 2024 13:35:06 +0200 Subject: [PATCH] Upload PR number and base SHA as artifact For later use in configuring codecov --- .github/workflows/test.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf16de8..52dd5a0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,8 @@ jobs: python-version: ["3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -46,3 +47,24 @@ jobs: name: reports-${{ matrix.python-version }} path: | reports/**/* + + upload-pr-number-base-sha: + name: Save PR number and base SHA in artifact + runs-on: ubuntu-latest + if: ${{ github.event.number && always() }} + env: + PR_NUMBER: ${{ github.event.number }} + BASE_SHA: ${{ github.event.pull_request.base.sha }} + steps: + - name: Make PR number file + run: | + mkdir -p ./extra + echo $PR_NUMBER > ./extra/pr_number + - name: Make base SHA file + run: | + echo $BASE_SHA > ./extra/base_sha + - name: Upload PR number file and base SHA file + uses: actions/upload-artifact@v4 + with: + name: extra + path: extra/