ateeducacion/Moodle Playground PR Preview
Automatically add a "Preview in Moodle Playground" button to your pull requests for easy testing of Moodle plugins.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jul 4, 2026
- License
- GPL 2.0
Pinned Snippet
uses: ateeducacion/action-moodle-playground-pr-preview@bfa63e4863a8cf9d6ac9394bd83f8669000dfd51 # v1tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| mode | How to publish the preview button: `append-to-description` or `comment` | — | append-to-description |
| playground-host | Base Moodle Playground host URL | — | https://moodle-playground.com |
| blueprint | Custom Moodle Playground Blueprint as a JSON string. When provided, `plugin-path` is ignored. | — | — |
| blueprint-file | Path to a local blueprint JSON file (requires actions/checkout). The action auto-replaces installMoodlePlugin and installTheme github.com archive URLs whose repo name matches the current repo (owner is ignored) with the PR branch archive URL. | — | — |
| blueprint-url | URL pointing to a remote blueprint. When provided, the Playground link uses `?blueprint-url={url}` directly. | — | — |
| proxy-url | Base URL of a github-proxy able to serve a single repo file with CORS (its `?repo=&branch=&path=` mode, e.g. https://github-proxy.exelearning.dev/). When set together with `blueprint-file`, the preview links to that file on the PR branch via `?blueprint-url=` instead of inlining the blueprint as base64 — keeping the URL short and avoiding HTTP 414 on large blueprints. The blueprint should use `{{REPO}}`/`{{REF}}` placeholders so the Playground installs the plugin from the PR branch. | — | — |
| plugin-path | Path to plugin directory inside the repository (e.g., `.` for root). Used to generate an installMoodlePlugin blueprint step. | — | — |
| moodle-version | Moodle version for the blueprint (e.g., "5.0", "4.4") | — | 5.0 |
| preview-type | Preview type: auto, plugin, or core | — | auto |
| base-version | Override Moodle Playground base version for core PR overlay previews | — | — |
| run-upgrade | Upgrade handling for core PR overlays: off, on, or auto | — | auto |
| core-root | Moodle filesystem root inside Moodle Playground | — | /www/moodle |
| max-core-files | Maximum number of changed files allowed in core overlay previews | — | 80 |
| max-core-file-bytes | Maximum size in bytes per changed file for core overlay previews | — | 262144 |
| allow-core-binary-files | Whether to allow binary files in core overlay previews | — | false |
| core-pr-mode | How to apply Moodle core PR changes. Currently only files is supported. | — | files |
| description-template | Custom markdown/HTML template for PR descriptions (supports {{VARIABLE_NAME}} interpolation) | — | — |
| comment-template | Custom markdown/HTML template for PR comments (supports {{VARIABLE_NAME}} interpolation) | — | — |
| extra-text | Optional text/HTML to display after the preview button (e.g., testing instructions). Also available as {{EXTRA_TEXT}} in custom templates. | — | — |
| restore-button-if-removed | Whether to restore the preview button if removed by PR author (only applies to `append-to-description` mode) | — | true |
| github-token | GitHub token for updating PRs (defaults to GITHUB_TOKEN). Required permissions: `pull-requests: write`, `contents: read` | — | — |
| pr-number | Pull request number (optional, defaults to context.payload.pull_request.number). When provided, all PR details will be fetched from the GitHub API. | — | — |
Outputs
| name | description |
|---|---|
| preview-url | Direct link to the generated Moodle Playground instance. |
| blueprint-json | JSON blueprint (stringified) used for the preview. |
| rendered-description | Markdown/HTML snippet inserted into the PR description. |
| rendered-comment | Markdown/HTML snippet used when posting a comment. |
| mode | Effective preview publishing mode (append-to-description or comment). |
| comment-id | ID of the managed preview comment (if applicable). |