diff --git a/.github/workflows/license-checker.yaml b/.github/workflows/license-checker.yaml new file mode 100644 index 00000000..d0019a89 --- /dev/null +++ b/.github/workflows/license-checker.yaml @@ -0,0 +1,51 @@ +# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. +# +# 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 + +name: Weekly License Header Check + +on: + workflow_call: + inputs: + file-exclusions-list: + description: "Files or folders to exclude from license header checks" + required: false + type: string +jobs: + license-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.CSM_GPG_PRIVATE_KEY }} + git_user_signingkey: true + git_commit_gpgsign: true + git_tag_gpgsign: true + git_config_global: true + + - name: Run License Header Checker + uses: dell/common-github-actions/license-checker@main + with: + autofix: true + exclude-files: ${{ inputs.file-exclusions-list }} + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: autofix/license-header + commit-message: "License header autofix" + title: "Fix license header inconsistencies" + body: | + This PR standardizes license headers across applicable files by adding missing licenses and fixing formatting issues. + Auto-generated by [common-github-actions](https://github.com/dell/common-github-actions) + sign-commits: true + delete-branch: false diff --git a/license-checker/action.yml b/license-checker/action.yml index 755a754c..c7dadafb 100644 --- a/license-checker/action.yml +++ b/license-checker/action.yml @@ -1,3 +1,11 @@ +# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. +# +# 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 + name: "License Header Checker" description: "Checks for license header" @@ -14,3 +22,4 @@ runs: image: "Dockerfile" args: - ${{ inputs.autofix }} + - ${{ inputs.exclude-files }}