Skip to content

H5PT-227 Add optional branch arg to setup#185

Open
SimenBergo wants to merge 1 commit into
masterfrom
feat/H5PT-227-pass-in-branch-name-as-arg
Open

H5PT-227 Add optional branch arg to setup#185
SimenBergo wants to merge 1 commit into
masterfrom
feat/H5PT-227-pass-in-branch-name-as-arg

Conversation

@SimenBergo

@SimenBergo SimenBergo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

H5PT-227 Add optional branch arg to setup

Let h5p setup clone the target content type from a specific git
branch instead of only master or a release tag.

Why:
CI needs to test the exact code in an open PR, but setup could
only fetch master/tags, so there was no way to build and serve a
proposed version of a content type. This lets a GitHub Action set up
and run the dev server on a PR branch and execute its e2e tests the
moment a PR is opened, catching regressions before anything is
deployed to a test environment.

How:
The branch is threaded only to the library being set up; its
dependencies still resolve to their normal master/tag versions. The
existing clone() already supports --branch, so this just exposes it.
Download (zip) can't target a branch, so it falls back to clone when a
branch is given. The branch name is validated before it reaches the
git shell command to avoid injection from untrusted PR refs. Both new
params are optional, so existing callers are unaffected.

This is ment to mainly be used in test automation, so another option was considering, adding this logic in the ci-workflows repo. This did seem to violate responsibility splitting though, so it seemed more fitting to add this logic here.

Usage:
h5p setup h5p-true-false '' '' fix/my-bug-branch
(version and download left empty; branch is the 4th positional arg)

@otacke otacke moved this to Backlog in H5P Open Source Project Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants