Skip to main content

Documentation 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.

The 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:
    permissions:
      contents: read
      pull-requests: write

Inputs

Publishing

mode
string
default:"append-to-description"
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.
description-template
string
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.).
comment-template
string
Custom template for the comment body rendered when mode is comment. Supports the same {{VAR}} interpolation as description-template.
extra-text
string
Additional text appended to the rendered output after the template, in both description and comment modes.
restore-button-if-removed
boolean
default:"true"
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

plugin-path
string
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.
blueprint
string
Inline blueprint as a JSON string. When set, plugin-path is ignored and this JSON is used verbatim as the preview blueprint.
blueprint-file
string
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.
blueprint-url
string
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.
proxy-url
string
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-version
string
default:"5.0"
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.
playground-host
string
default:"https://moodle-playground.com"
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-type
string
default:"auto"
Preview strategy. Accepted values:
  • auto — detects whether the repository is a Moodle core repository and selects core or plugin accordingly.
  • 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.
base-version
string
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_STABLE4.4, MOODLE_500_STABLE5.0, main/masterdev).
run-upgrade
string
default:"auto"
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.
core-root
string
default:"/www/moodle"
Filesystem path to the Moodle root inside the playground’s WASM environment. Used as the target directory when applying core overlays.
max-core-files
number
default:"80"
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.
max-core-file-bytes
number
default:"262144"
Maximum size per overlaid core file, in bytes (default 256 KiB). Files larger than this limit are excluded from the overlay silently.
allow-core-binary-files
boolean
default:"false"
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-mode
string
default:"files"
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
string
default:"${{ secrets.GITHUB_TOKEN }}"
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.
pr-number
number
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 via steps.<step-id>.outputs.<name>.
OutputDescription
preview-urlThe full Open in Moodle Playground URL posted to the PR.
blueprint-jsonThe blueprint JSON string used to generate the preview URL.
rendered-descriptionThe complete rendered PR description string, when mode is append-to-description.
rendered-commentThe complete rendered comment body string, when mode is comment.
modeThe publish mode that was actually used (append-to-description or comment).
comment-idThe 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.

Build docs developers (and LLMs) love