From f4892b4a82906d1fb85c84377e9e44be3d498a9f Mon Sep 17 00:00:00 2001 From: Dream <2468001320@qq.com> Date: Thu, 27 Aug 2026 20:21:14 +0800 Subject: [PATCH] feat: add reusable verify-boilerplate composite action --- .github/actions/verify-boilerplate/action.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/actions/verify-boilerplate/action.yml diff --git a/.github/actions/verify-boilerplate/action.yml b/.github/actions/verify-boilerplate/action.yml new file mode 100644 index 000000000..7c329415b --- /dev/null +++ b/.github/actions/verify-boilerplate/action.yml @@ -0,0 +1,38 @@ +name: "Verify Boilerplate Copyright Headers" +description: >- + Runs kubeflow/testing's hack/boilerplate/boilerplate.py against the repo's + changed files so callers never need to vendor a divergent copy of the script. +inputs: + base-ref: + description: >- + Base ref to diff against for new-file detection. Defaults to the PR base + branch (github.base_ref). + required: false + default: ${{ github.base_ref }} + boilerplate-dir: + description: >- + Directory containing the boilerplate template files. Defaults to the + vendored templates shipped with this action. + required: false + default: ${{ github.action_path }}/../../../hack/boilerplate + python-version: + description: Python version used to run the checker. + required: false + default: "3.12" +runs: + using: "composite" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + + - name: Run boilerplate verification + shell: bash + run: | + python "${{ github.action_path }}/../../../hack/boilerplate/boilerplate.py" --boilerplate-dir "${{ inputs.boilerplate-dir }}" --base-ref "${{ inputs.base-ref }}"