TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ateeducacion/moodle-playground/llms.txt
Use this file to discover all available pages before exploring further.
ateeducacion/action-moodle-playground-pr-preview action posts an Open in Moodle Playground button on pull requests, letting reviewers launch a fully configured Moodle instance in the browser with one click. This page documents every input and output for @v1. For task-focused examples and common scenarios, see PR Previews.
All inputs are optional. github-token defaults to the workflow’s built-in GITHUB_TOKEN. The action infers the PR number from the triggering event when pr-number is not set.
Required permissions
The job must declare these permissions so the action can read repository contents and post or update the preview button on the pull request:Inputs
Publishing
Where to publish the preview button. Accepted values:
append-to-description— appends the button to the PR description. The action adds or updates a dedicated section without touching the rest of the description.comment— posts the button as a PR comment. The action creates or updates a single comment per PR across runs.
Custom template for the PR description section rendered when
mode is append-to-description. Supports {{VAR}} interpolation with the output variables ({{preview-url}}, {{blueprint-json}}, etc.).Custom template for the comment body rendered when
mode is comment. Supports the same {{VAR}} interpolation as description-template.Additional text appended to the rendered output after the template, in both description and comment modes.
When
true, re-adds the preview button if a reviewer manually removed it from the PR description or deleted the comment. Set to false to suppress restoration.Blueprint source
Path to the plugin directory relative to the repository root (for example
. or plugins/mod_myplugin). The action generates an installMoodlePlugin blueprint step that installs the plugin from the PR branch. Ignored when blueprint is set.Inline blueprint as a JSON string. When set,
plugin-path is ignored and this JSON is used verbatim as the preview blueprint.Path to a blueprint JSON file within the checked-out repository (requires
actions/checkout before this action). The action rewrites any installMoodlePlugin or installTheme GitHub archive URLs that reference this repository to point at the PR branch automatically.URL of a remote blueprint JSON file. The generated preview link uses a
?blueprint-url= query parameter rather than embedding the blueprint inline, keeping the URL short regardless of blueprint size.Base URL of a CORS-enabled GitHub proxy that serves a single repository file. Use together with
blueprint-file to avoid HTTP 414 errors when the blueprint is too large to inline in the URL.Moodle version
Moodle branch or version string for the preview. Used when
preview-type is plugin or auto (resolving to plugin). Examples: 4.5, 5.0, 5.1.Base URL of the Moodle Playground deployment the preview link points at. Override this to direct reviewers to a custom deployment, a GitHub Pages host, or a branch preview.
Core overlay
Preview strategy. Accepted values:
auto— detects whether the repository is a Moodle core repository and selectscoreorpluginaccordingly.plugin— always treat the PR as a plugin or theme installation.core— overlay the PR’s changed files over a prebuilt Moodle base. Does not perform a full Moodle build.
Override the Moodle base version used for core overlays. When omitted, the version is inferred from the PR target branch name (for example
MOODLE_404_STABLE → 4.4, MOODLE_500_STABLE → 5.0, main/master → dev).Whether to run the Moodle database upgrade after applying a core overlay. Accepted values:
auto— runs the upgrade only when the overlay includes PHP files that are likely to require it.on— always run the upgrade.off— never run the upgrade.
Filesystem path to the Moodle root inside the playground’s WASM environment. Used as the target directory when applying core overlays.
Maximum number of changed core files to include in the overlay. PRs that exceed this limit will have the overlay truncated; the preview boots but may not reflect all changes.
Maximum size per overlaid core file, in bytes (default 256 KiB). Files larger than this limit are excluded from the overlay silently.
When
true, binary files (images, fonts, compiled assets, etc.) are included in core overlays. By default binary files are skipped to keep the overlay size down and avoid incompatible format issues inside the WASM runtime.Core PR overlay mode. Controls how the action retrieves and applies the changed files from the PR. The default
files mode fetches individual file contents; other values may be introduced in future versions.Authentication and targeting
GitHub token used to post the preview button (description update or comment) and to read PR metadata. Defaults to the workflow’s built-in
GITHUB_TOKEN. Supply a PAT with repo scope only when the default token lacks sufficient permissions for your repository configuration.Pull request number to target. When omitted, the action reads the PR number from the workflow event context. Set this explicitly when triggering the action from a workflow event that does not carry a PR number (for example
workflow_dispatch).Outputs
The following outputs are available to subsequent steps in the same job viasteps.<step-id>.outputs.<name>.
| Output | Description |
|---|---|
preview-url | The full Open in Moodle Playground URL posted to the PR. |
blueprint-json | The blueprint JSON string used to generate the preview URL. |
rendered-description | The complete rendered PR description string, when mode is append-to-description. |
rendered-comment | The complete rendered comment body string, when mode is comment. |
mode | The publish mode that was actually used (append-to-description or comment). |
comment-id | The ID of the created or updated PR comment, when mode is comment. Useful for linking or further updates from subsequent steps. |
See the action repository README for the latest input list, changelog, and advanced configuration examples. The reference above reflects
@v1.