Forgejo Actions: PR number not detected — GITHUB_EVENT_PATH not forwarded to Docker container #47

Closed
opened 2026-07-07 23:27:29 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-07-07 23:27:29 +00:00 (Migrated from codeberg.org)

Bug

When WuMing is used as a Forgejo Actions step (uses: https://codeberg.org/marvin8/wuming@main), it logs:

CI_COMMIT_PULL_REQUEST not set — nothing to review

even when triggered by a real pull_request event.

Root cause

action.yml maps WUMING_EVENT_PATH from the forgejo_event_path input:

WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path }}

When the caller does not supply forgejo_event_path, this resolves to the input default of "". Docker container actions do not automatically inherit GITHUB_EVENT_PATH from the runner environment, so _parse_pr_index_from_event() receives an empty path and returns "", leaving config.pr_index empty.

Fix

Use the expression fallback in action.yml:

WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path || github.event_path }}

github.event_path is the expression-context equivalent of GITHUB_EVENT_PATH and is always available to Docker container actions via the runner expression evaluator.

## Bug When WuMing is used as a Forgejo Actions step (`uses: https://codeberg.org/marvin8/wuming@main`), it logs: ``` CI_COMMIT_PULL_REQUEST not set — nothing to review ``` even when triggered by a real `pull_request` event. ## Root cause `action.yml` maps `WUMING_EVENT_PATH` from the `forgejo_event_path` input: ```yaml WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path }} ``` When the caller does not supply `forgejo_event_path`, this resolves to the input default of `""`. Docker container actions do not automatically inherit `GITHUB_EVENT_PATH` from the runner environment, so `_parse_pr_index_from_event()` receives an empty path and returns `""`, leaving `config.pr_index` empty. ## Fix Use the expression fallback in `action.yml`: ```yaml WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path || github.event_path }} ``` `github.event_path` is the expression-context equivalent of `GITHUB_EVENT_PATH` and is always available to Docker container actions via the runner expression evaluator.
coding-agent-marvin8 commented 2026-07-07 23:27:40 +00:00 (Migrated from codeberg.org)

Findings

Confirmed by inspecting runner logs from https://codeberg.org/marvinsmastodontools/longwei/pulls/23 — the runner (v12.12.0) fires the pull_request event correctly but WuMing exits immediately because pr_index is empty.

Trace through the code:

  1. action.yml env block sets WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path }} → resolves to "" when caller omits the input
  2. config.py:_parse_pr_index_from_event() checks WUMING_EVENT_PATH first (empty), then GITHUB_EVENT_PATH (not present in Docker container env)
  3. Returns ""config.pr_index is falsy → early exit

Plan

Single-file fix in action.yml:

# before
WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path }}

# after
WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path || github.event_path }}

No changes needed in Python — the config layer already handles WUMING_EVENT_PATH correctly once it receives a non-empty value.

Branch: fix/issue-47-event-path
Commit: :bug: fix: forward github.event_path to Docker container action

## Findings Confirmed by inspecting runner logs from https://codeberg.org/marvinsmastodontools/longwei/pulls/23 — the runner (v12.12.0) fires the `pull_request` event correctly but WuMing exits immediately because `pr_index` is empty. Trace through the code: 1. `action.yml` env block sets `WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path }}` → resolves to `""` when caller omits the input 2. `config.py:_parse_pr_index_from_event()` checks `WUMING_EVENT_PATH` first (empty), then `GITHUB_EVENT_PATH` (not present in Docker container env) 3. Returns `""` → `config.pr_index` is falsy → early exit ## Plan Single-file fix in `action.yml`: ```yaml # before WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path }} # after WUMING_EVENT_PATH: ${{ inputs.forgejo_event_path || github.event_path }} ``` No changes needed in Python — the config layer already handles `WUMING_EVENT_PATH` correctly once it receives a non-empty value. Branch: `fix/issue-47-event-path` Commit: `:bug: fix: forward github.event_path to Docker container action`
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/wuming#47
No description provided.