Skip to content

[MAINT] Github Actions Reunification - coding-standardΒ #331

@damienwebdev

Description

@damienwebdev

Action: coding-standard

Status: πŸ”΄ Significantly diverged
Files: coding-standard/action.yml


Summary of differences

Area Graycore (source of truth) Mage-OS (fork)
php_version / composer_version inputs Not present β€” PHP setup is done by the calling workflow Present β€” action handles its own PHP setup
composer_auth input Present Absent
Checkout step Absent β€” caller must checkout Present β€” action checks out project at path: project
Standard install dir inputs.path (caller's working dir) Separate standard/ directory
Already-installed check Checks if coding standard is already installed and skips install Always installs fresh
Changed-files detection Absent Present β€” on PRs, only checks changed files
mage-os vendor support Yes β€” handles both vendor/magento and vendor/mage-os No β€” hardcodes vendor/magento
php-compatibility-fork Required alongside coding standard Not required
Action refs graycoreio/github-actions-magento2/...@main mage-os/github-actions/...@main
Branding Present (icon: code, color: green) Absent
path default . app/code

Dependents (mage-os/github-actions consumers)

No external repos depend on coding-standard directly (per dependents.md).
Note: coding-standard-baseline (a separate mage-os-only action) has external dependents β€” do not confuse the two.


Changes needed in mage-os fork

This is a substantive architectural difference. The mage-os fork reimplemented the action to embed its own PHP setup and checkout, while graycore keeps the action lean and delegates PHP setup to callers.

  1. Adopt graycore's architecture β€” remove embedded checkout/PHP-setup steps; let calling workflows handle PHP version and composer version
  2. Add composer_auth input
  3. Port the already-installed check (steps.check-installed) to skip install when coding standard is already present
  4. Port mage-os vendor support β€” handle both vendor/magento/magento-coding-standard and vendor/mage-os/magento-coding-standard
  5. Port php-compatibility-fork requirement to composer require
  6. Port improved phpcs flags handling β€” bash array approach with conditional appending
  7. Port branding block
  8. Update path default from app/code to .
  9. Remove changed-files detection step (not present in graycore) β€” or keep as mage-os addition after discussion

Internal workflow impact

After this action is updated, _internal-coding-standard.yaml also needs:

  • supported-version kind changed from all to currently-supported
  • actions/checkout bumped from v4 to v6

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions