Skip to content

feat: add reusable verify-boilerplate composite action - #1071

Open
TrueFurina wants to merge 1 commit into
kubeflow:masterfrom
TrueFurina:feat/verify-boilerplate-composite-action
Open

feat: add reusable verify-boilerplate composite action#1071
TrueFurina wants to merge 1 commit into
kubeflow:masterfrom
TrueFurina:feat/verify-boilerplate-composite-action

Conversation

@TrueFurina

Copy link
Copy Markdown

Summary

Adds a reusable composite action (.github/actions/verify-boilerplate) that wraps this repo's hack/boilerplate/boilerplate.py, so Kubeflow repos can call it directly instead of vendoring and maintaining a divergent copy of the script (which currently drifts and makes the "downloaded from kubeflow/testing @ " comment unverifiable).

Requirements met

  • Composite action wrapping hack/boilerplate/boilerplate.py, script sourced from this repo — callers never vendor it
  • base-ref input defaulting to github.base_ref (PR base branch), so only changed/new files drive new-file detection
  • boilerplate-dir input for repos that keep custom templates (defaults to this repo's templates)
  • Sets up Python itself (actions/setup-python) so callers don't each add a setup step
  • Non-zero exit with the existing remediation output on failure (boilerplate.py exits 1 with remediation text)

Changes

  • New file: .github/actions/verify-boilerplate/action.yml

Verification

  • YAML structure follows the composite-action spec (runs.using: composite)
  • Defaults reference github.base_ref and github.action_path correctly

@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nsingla for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -0,0 +1,38 @@
name: "Verify Boilerplate Copyright Headers"
description: >-
Runs kubeflow/testing's hack/boilerplate/boilerplate.py against the repo's

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a spell checker.

Repo -> repository

inputs:
base-ref:
description: >-
Base ref to diff against for new-file detection. Defaults to the PR base

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ref -> reference

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base-reference

branch (github.base_ref).
required: false
default: ${{ github.base_ref }}
boilerplate-dir:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dir -> directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants