Add Forgejo/GitHub Actions support (action.yml + CI context detection) #39
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WuMing currently reads CI context only from Woodpecker environment variables. To support Forgejo Actions and GitHub Actions as a native action, two changes are needed:
action.ymlat the repo root wrapping the published container image so consumers can reference WuMing viauses: marvin8/wuming@main._detect_ci_context()toconfig.pythat reads Woodpecker vars first and falls back toGITHUB_*vars (auto-injected by Forgejo/GitHub Actions runners) for repo identity, PR number, commit SHA, and Forgejo URL.No changes to Woodpecker deployments — the Woodpecker path is detected first and takes priority.
Plan of attack:
Key files:
src/wuming/config.py, newaction.yml, newtests/test_config_ci_context.py, docs.Sequence:
CIContextfrozen dataclass (owner, name, pr_index, sha, forgejo_url) toconfig.py._parse_pr_index_from_event()— reads path fromWUMING_EVENT_PATHorGITHUB_EVENT_PATH, parses JSON, returns PR number string._detect_ci_context()— Woodpecker vars (CI_REPO_OWNER present) → return immediately; else read GITHUB_* vars.load_config()to call_detect_ci_context()instead of reading CI_* vars directly.action.ymlusingdocker://codeberg.org/marvin8/wuming:latest.