name: PR Split Score
on:
pull_request:
branches:
permissions:
contents: read
pull-requests: write
# A new push to the same PR supersedes the queued or running analysis of the
# previous head; cancelling it keeps the runner queue for live heads.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
score:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: pr-split score
uses: vitali87/pr-split@95cdcd9748109351b2aa7129ede2269989d8f61c # v1.0.1
with:
max-loc: "400"
# A fork PR (or Dependabot's) runs with a read-only token, so the
# comment call would throw and turn the check red. Fork PRs are
# scored but get no comment. pull_request_target would restore the
# write token, but alongside the checkout above it would run fork
# code with that token.
post-comment: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}