Files
pyo3/.github/workflows/coverage-pr-base.yml

47 lines
1.5 KiB
YAML

# This runs as a separate job because it needs to run on the `pull_request_target` event
# in order to access the CODECOV_TOKEN secret.
#
# This is safe because this doesn't run arbitrary code from PRs.
name: Set Codecov PR base
on:
# See safety note / doc at the top of this file.
pull_request_target:
permissions:
contents: read
jobs:
coverage-pr-base:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7.0.1
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: astral-sh/setup-uv@v7
with:
# avoid possibility of cache poisoning
enable-cache: false
save-cache: false
- name: Fetch merge base
id: fetch_merge_base
uses: ./.github/actions/fetch-merge-base
with:
base_ref: "refs/heads/${{ github.event.pull_request.base.ref }}"
head_ref: "refs/pull/${{ github.event.pull_request.number }}/head"
- name: Set PR base on codecov
env:
CODECOV_BASE_SHA: ${{ steps.fetch_merge_base.outputs.merge_base }}
CODECOV_PR: ${{ github.event.number }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
uv run --locked --no-build --only-group codecov \
codecovcli pr-base-picking \
--base-sha "$CODECOV_BASE_SHA" \
--pr "$CODECOV_PR" \
--slug PyO3/pyo3 \
--token "$CODECOV_TOKEN" \
--service github