Add reusable PHPCS and AI-checklist workflows for plugin repos, PG-4897 - #45
Closed
snake14 wants to merge 10 commits into
Closed
Add reusable PHPCS and AI-checklist workflows for plugin repos, PG-4897#45snake14 wants to merge 10 commits into
snake14 wants to merge 10 commits into
Conversation
matomo-tests.yml is deliberately excluded: it is produced by core's generate:test-action and varies per plugin, so its centralization path is through that generator.
Centralizing removes the reason the gate floated on main: an update is now one SHA bump here instead of a change in every plugin repo. The README section will conflict trivially with #44's; whichever merges second rebases the append.
A called workflow cannot request more than its caller holds, so the inherited blanket read scopes made every default-permission caller fail at startup. PHPCS needs only contents: read; the checklist gate needs pull-requests: read, which its callers grant explicitly.
lachiebol
previously approved these changes
Aug 4, 2026
lachiebol
left a comment
There was a problem hiding this comment.
LGTM, do we have any plans to migrate our plugins over?
| fail-fast: false | ||
| steps: | ||
| - name: Run tests | ||
| uses: matomo-org/github-action-checklist-gate@d5f101a2538ef30ddb3b06cc366f852c9851b588 # main as of 2026-08-04 |
There was a problem hiding this comment.
Is there a reason we use this d5f1 commit instead of main?
snake14
marked this pull request as ready for review
August 4, 2026 23:22
Contributor
Author
@lachiebol Yeah. I figured that I could have Claude open a bunch of PRs to migrate to shared workflows once these PRs are merged. |
Contributor
Author
|
Apologies @lachiebol . I realised that the workflow didn't have a name. Could you please give it another approval? |
10 tasks
lachiebol
previously approved these changes
Aug 5, 2026
10 tasks
…orkflows # Conflicts: # README.md
Contributor
Author
|
Closing as this will go into a new repo. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Extends the centralization started in #44 to the two remaining plugin workflows that are effectively identical across repositories:
plugin-phpcs.yml— the per-pluginphpcs.ymlcopies differ only in the lowercased plugin name passed tocomposer initand in drifted PHP versions (7.4 vs 8.1 across repos today); both become inputs. The setup-php action is pinned by hash, matching Add a reusable PHPStan workflow and the canonical pre-push hook, PG-4897 #44.plugin-ai-checklist.yml— the per-pluginmatomo-ai-checklist.ymlis byte-identical in every repo that has one, and some repos simply lack it (ApiReference only gained it recently); a reusable workflow makes adoption a 7-line caller.Caller shape, respectively:
Deliberately excluded:
matomo-tests.yml. It is generated by core's./console generate:test-actionand genuinely varies per plugin (custom PHP version matrices,--setup-script,--has-submodules,--protect-artifacts, per-repo cron schedules). Its centralization path is evolving the generator to emit a thin caller of a reusable workflow, which is a core change and should be its own ticket.README documentation for these two will follow in #44 or after it merges, to avoid conflicting edits to the same README section.
Ticket: PG-4897.
Checklist
Review