Forgejo Actions: PR number not detected — GITHUB_EVENT_PATH not forwarded to Docker container #47
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?
Bug
When WuMing is used as a Forgejo Actions step (
uses: https://codeberg.org/marvin8/wuming@main), it logs:even when triggered by a real
pull_requestevent.Root cause
action.ymlmapsWUMING_EVENT_PATHfrom theforgejo_event_pathinput:When the caller does not supply
forgejo_event_path, this resolves to the input default of"". Docker container actions do not automatically inheritGITHUB_EVENT_PATHfrom the runner environment, so_parse_pr_index_from_event()receives an empty path and returns"", leavingconfig.pr_indexempty.Fix
Use the expression fallback in
action.yml:github.event_pathis the expression-context equivalent ofGITHUB_EVENT_PATHand is always available to Docker container actions via the runner expression evaluator.Findings
Confirmed by inspecting runner logs from https://codeberg.org/marvinsmastodontools/longwei/pulls/23 — the runner (v12.12.0) fires the
pull_requestevent correctly but WuMing exits immediately becausepr_indexis empty.Trace through the code:
action.ymlenv block setsWUMING_EVENT_PATH: ${{ inputs.forgejo_event_path }}→ resolves to""when caller omits the inputconfig.py:_parse_pr_index_from_event()checksWUMING_EVENT_PATHfirst (empty), thenGITHUB_EVENT_PATH(not present in Docker container env)""→config.pr_indexis falsy → early exitPlan
Single-file fix in
action.yml:No changes needed in Python — the config layer already handles
WUMING_EVENT_PATHcorrectly once it receives a non-empty value.Branch:
fix/issue-47-event-pathCommit:
:bug: fix: forward github.event_path to Docker container action