mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 19:17:28 +01:00
GitHub-hosted jobs in this org can queue for a long time; the test workflow already sends same-repository PRs to the self-hosted runners and forks to a hosted one. The spec-trace job does the same. It runs no PR code on either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
2.0 KiB
YAML
51 lines
2.0 KiB
YAML
name: spec trace
|
|
|
|
# Every PR description carries the spec trace (see the PR template); this
|
|
# check fails a PR whose description does not.
|
|
#
|
|
# pull_request_target: the workflow and the script come from the base branch,
|
|
# so a PR cannot change its own check. The PR's code is never checked out or
|
|
# run: only its commit is fetched, for the file list. The description is read
|
|
# from the event through an environment variable, never interpolated.
|
|
on:
|
|
pull_request_target:
|
|
# edited: the check reads the description and the base.
|
|
types: [opened, synchronize, reopened, edited]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: spec-trace-${{ github.event.pull_request.number }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
trace:
|
|
name: spec trace
|
|
# Same-repository PRs use the project's self-hosted runners, as the test
|
|
# workflow does; fork PRs stay on a GitHub-hosted runner, whose shared queue
|
|
# can wait for hours. No PR code runs here either way.
|
|
runs-on: ${{ github.event.pull_request.head.repo.full_name == github.repository && 'tp04-seaweed-block' || 'ubuntu-latest' }}
|
|
timeout-minutes: 5
|
|
steps:
|
|
- name: Checkout base
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
with:
|
|
ref: ${{ github.event.pull_request.base.sha }}
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Check spec trace
|
|
env:
|
|
BASE: ${{ github.event.pull_request.base.sha }}
|
|
HEAD: ${{ github.event.pull_request.head.sha }}
|
|
PR: ${{ github.event.pull_request.number }}
|
|
BODY: ${{ github.event.pull_request.body }}
|
|
run: |
|
|
set -euo pipefail
|
|
bash .github/scripts/spec-trace-check-test.sh
|
|
git fetch --no-tags origin "+refs/pull/${PR}/head:refs/remotes/pr/head"
|
|
printf '%s' "$BODY" >body.txt
|
|
bash .github/scripts/post-merge-review-changed.sh "$BASE" "$HEAD" >changed.bin
|
|
bash .github/scripts/spec-trace-check.sh body.txt <changed.bin
|