Skip to content

Extract the PHP version alias table into a shared script - #51

Merged
sgiehl merged 1 commit into
mainfrom
extract-php-version-aliases
Aug 24, 2026
Merged

Extract the PHP version alias table into a shared script#51
sgiehl merged 1 commit into
mainfrom
extract-php-version-aliases

Conversation

@snake14

@snake14 snake14 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Split out of #49 so it can be reviewed on its own, because it is the only part of that PR that belongs to this action regardless of where the plugin quality workflows end up living.

The PHP version alias table (matomo5_min_php and friends) was a case statement inline in action.yml, so nothing outside this action could resolve the aliases without copying the numbers. This moves the table to scripts/bash/resolve_php_version.sh and has action.yml call it — the same pattern as the other shared scripts here, which means a workflow in another repository can resolve the same values by checking this repository out at a pinned ref.

No behaviour change: all six cases resolve exactly as before (7.2, 8.5, 8.1, 8.5, literal passthrough, and empty). Empty input previously ended the step with exit 0 and now returns an empty string; the Setup PHP step is already guarded with if: steps.resolve-php.outputs.version != '', so it is still skipped.

One incidental hardening rides along on the same lines: the input now reaches the script through env: instead of being interpolated into the shell as ${{ inputs.php-version }}, so a caller-supplied value is never expanded as shell.

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

The table was inline in action.yml, so nothing outside this action could resolve
the aliases without copying the numbers.
@snake14

snake14 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @sgiehl Can you please merge, since I don't have authorization for this repo?

@sgiehl
sgiehl merged commit 24b3e50 into main Aug 24, 2026
1 check passed
@snake14
snake14 deleted the extract-php-version-aliases branch August 24, 2026 07:24
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