-
Notifications
You must be signed in to change notification settings - Fork 90
feat: add reusable verify-boilerplate composite action #1070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
google-oss-prow
merged 12 commits into
kubeflow:master
from
Prachi01Yadav:feat/verify-boilerplate-action
Sep 8, 2026
+115
−0
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a01dd39
feat: add reusable verify-boilerplate composite action
Prachi01Yadav 7b656be
fix: use major version tags for actions
Prachi01Yadav 01855da
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav c07e06b
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav 6d99962
refactor: remove cleanup step per review
Prachi01Yadav 385432c
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav 8dbe6c7
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav d8ff806
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav 3709e11
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav 0fa10f0
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav 14cebb1
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav b1bf338
Update .github/actions/verify-boilerplate/action.yml
Prachi01Yadav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Copyright The Kubeflow Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Verify Boilerplate Headers | ||
| description: > | ||
| Verify that every source file carries the required Apache 2.0 copyright | ||
| header. Wraps hack/boilerplate/boilerplate.py from kubeflow/testing so | ||
| callers never need to vendor the script. | ||
|
|
||
| inputs: | ||
| base-ref: | ||
| description: > | ||
| Base branch for new-file detection. Defaults to the pull-request base | ||
| branch (github.base_ref) so only changed/new files are flagged for | ||
| year-less header enforcement. | ||
|
Prachi01Yadav marked this conversation as resolved.
Outdated
|
||
| required: false | ||
| default: "" | ||
| boilerplate-dir: | ||
| description: > | ||
| Directory containing boilerplate template files (boilerplate.*.txt). | ||
| Leave empty to use the templates shipped with kubeflow/testing. | ||
| required: false | ||
| default: "" | ||
|
Prachi01Yadav marked this conversation as resolved.
Outdated
|
||
| python-version: | ||
| description: Python version to use. | ||
|
Prachi01Yadav marked this conversation as resolved.
Outdated
|
||
| required: false | ||
| default: "3.12" | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
|
Prachi01Yadav marked this conversation as resolved.
|
||
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
|
Prachi01Yadav marked this conversation as resolved.
|
||
|
|
||
| - name: Checkout kubeflow/testing | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
Prachi01Yadav marked this conversation as resolved.
Outdated
|
||
| with: | ||
| repository: kubeflow/testing | ||
| path: .kubeflow-testing | ||
| sparse-checkout: hack/boilerplate | ||
|
|
||
| - name: Run boilerplate check | ||
| shell: bash | ||
| env: | ||
| BASE_REF: ${{ inputs.base-ref || github.base_ref || 'master' }} | ||
| BOILERPLATE_DIR: ${{ inputs.boilerplate-dir }} | ||
| run: | | ||
| ARGS=("--base-ref" "${BASE_REF}") | ||
|
|
||
| if [[ -n "${BOILERPLATE_DIR}" ]]; then | ||
| ARGS+=("--boilerplate-dir" "${BOILERPLATE_DIR}") | ||
| else | ||
| ARGS+=("--boilerplate-dir" ".kubeflow-testing/hack/boilerplate") | ||
| fi | ||
|
|
||
| python .kubeflow-testing/hack/boilerplate/boilerplate.py "${ARGS[@]}" | ||
|
Prachi01Yadav marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| shell: bash | ||
| run: rm -rf .kubeflow-testing | ||
|
Prachi01Yadav marked this conversation as resolved.
Outdated
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.