paperclip/.github/workflows/pr.yml

38 lines
1.2 KiB
YAML

name: PR
on:
pull_request:
permissions:
actions: read
contents: read
pull-requests: read
jobs:
branch-freshness:
name: branch-freshness
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Verify head contains the triggering base
shell: bash
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
GH_TOKEN: ${{ github.token }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail
[[ "$BASE_SHA" =~ ^[0-9a-f]{40}$ ]]
[[ "$HEAD_SHA" =~ ^[0-9a-f]{40}$ ]]
comparison="$(curl --fail-with-body --silent --show-error \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer $GH_TOKEN" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/compare/$BASE_SHA...$HEAD_SHA")"
jq --exit-status '.status == "ahead" or .status == "identical"' <<<"$comparison"
ci:
# Pin: #13300 merge — restore-only dependency caches and parallel native verification.
uses: paperclipai/paperclip/.github/workflows/pr-trusted.yml@44dde2dec42a22746a2f36b595acacc9ccfa1df6