Skip to content

Commit

Permalink
GHA - Set PR numbers for forked repos (#3195)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong authored May 1, 2024
1 parent 47292b3 commit 09fde4e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci-pr-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ jobs:
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GH_PAT }}
pattern: coverage-*
merge-multiple: true

- name: Read PR
uses: actions/github-script@v7
id: set-pr
with:
script: return Number(fs.readFileSync('./NR'));
result-encoding: string
- name: Upload coverage report
if: '!cancelled()'
uses: codecov/codecov-action@v4
with:
override_commit: ${{ github.event.workflow_run.head_sha }}
override_pr: ${{ github.event.workflow_run.pull_requests[0].number }}
override_build: ${{ github.event.workflow_run.id }}
override_pr: ${{steps.set-pr.outputs.result}}
token: ${{ secrets.CODECOV_TOKEN }}
exclude: ".github"
files: ".coverage.3.8.xml,.coverage.3.9.xml,.coverage.3.10.xml,.coverage.3.11.xml,.coverage.3.12.xml"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ jobs:
with:
name: coverage-${{ matrix.python }}
path: .coverage.${{ matrix.python }}.xml
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/
integration:
runs-on: ${{ matrix.os }}
strategy:
Expand Down

0 comments on commit 09fde4e

Please sign in to comment.