Skip to content

Add reusable license check workflow for plugin repos - #46

Closed
snake14 wants to merge 5 commits into
mainfrom
license-header-check
Closed

Add reusable license check workflow for plugin repos#46
snake14 wants to merge 5 commits into
mainfrom
license-header-check

Conversation

@snake14

@snake14 snake14 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a reusable workflow (.github/workflows/plugin-license-check.yml) plugin repositories can call to verify their licensing is consistent. It checks that the repository ships a LICENSE/LICENSE.md file matching the license declared in plugin.json, and that source files (*.php, *.js, *.ts, *.vue) carry the matching license header — the GPL header for OSS plugins, the InnoCraft EULA header for premium ones. A file carrying the opposite header fails the check; files with no recognized header are warnings (opt into failing via the fail-on-missing-header input). Repositories can skip files via glob patterns in a .license-check-ignore file, e.g. bundled third-party code or released migrations.

A caller workflow is a few lines (see the README section this PR adds). Piloted on innocraft/plugin-Funnels#289, where it runs green; local runs against LoginLdap and Funnels also caught real wrong-header files, since fixed (matomo-org/plugin-LoginLdap#459). The Funnels pilot pins its refs to this branch and switches to @main once this merges.

Checklist

  • [✔] I have understood, reviewed, and tested all AI outputs before use
  • [✔] All AI instructions respect security, IP, and privacy rules

Review

@snake14 snake14 added the Needs Review For pull requests that need a code review. label Aug 4, 2026
@snake14
snake14 marked this pull request as ready for review August 4, 2026 23:49

@AltamashShaikh AltamashShaikh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@snake14 Is this correct ?

  Medium-risk issues

  - Version drift between the reusable workflow ref and the checked-out script source. See .github/workflows/plugin-license-check.yml:11.

@snake14

snake14 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@snake14 Is this correct ?

  Medium-risk issues

  - Version drift between the reusable workflow ref and the checked-out script source. See .github/workflows/plugin-license-check.yml:11.

@AltamashShaikh Correct as an observation, but it's the same deliberate trade-off as plugin-phpstan.yml in #44: GitHub provides no context identifying a called reusable workflow's own commit (github.job_workflow_sha evaluates to empty — verified empirically during #44's smoke tests), so the script pin has to be an explicit input. With the @main convention there's no drift; a caller that pins the workflow to a SHA passes the same SHA as script-ref. 5155e11 documents this on the input and adds the explanatory comment to match #44.

AltamashShaikh
AltamashShaikh previously approved these changes Aug 7, 2026
@snake14
snake14 removed request for a team and lachiebol August 20, 2026 21:45
@snake14 snake14 removed the Needs Review For pull requests that need a code review. label Aug 20, 2026
@snake14

snake14 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Closing as this will go into a new repo.

@snake14 snake14 closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants