bug: pull_request events not fired for API-created PRs #220

Closed
opened 2026-05-26 19:00:42 +00:00 by jmiller · 1 comment
Owner

Summary

When a pull request is created via the Gitea API (POST /repos/{owner}/{repo}/pulls), the pull_request: opened event does not fire. This means Actions workflows with on: pull_request: types: [opened] are never triggered for API-created PRs.

PRs created through the web UI do fire the event correctly.

Reproduction

  1. Create a workflow with on: pull_request: types: [opened]
  2. Create a PR via API: POST /api/v1/repos/Org/Repo/pulls
  3. Observe: no workflow run is triggered
  4. Create a PR via web UI for the same branches
  5. Observe: workflow fires correctly

Impact

High — This breaks automated release promotion workflows. Our CI pipeline promotes pre-releases to RC when a draft PR is opened to main. Since most PRs are created programmatically (via CLI tools, automation, Claude Code), the RC promotion step is completely bypassed.

Affected repos

All repos using the Universal Build & Release workflow (auto-release.yml) — currently 37+ repos across MokoConsulting.

Environment

  • Gitea version: 1.26.1+397-g1e1441f8bd
  • Runners: act_runner nightly-dind-rootless (3 instances)

Expected Behavior

API-created PRs should fire the same pull_request webhook events as UI-created PRs, matching GitHub Actions behavior.

Workaround

Currently using workflow_dispatch as a manual fallback, but this defeats the purpose of the automated promotion pipeline.

Related

## Summary When a pull request is created via the Gitea API (`POST /repos/{owner}/{repo}/pulls`), the `pull_request: opened` event does **not** fire. This means Actions workflows with `on: pull_request: types: [opened]` are never triggered for API-created PRs. PRs created through the web UI do fire the event correctly. ## Reproduction 1. Create a workflow with `on: pull_request: types: [opened]` 2. Create a PR via API: `POST /api/v1/repos/Org/Repo/pulls` 3. Observe: no workflow run is triggered 4. Create a PR via web UI for the same branches 5. Observe: workflow fires correctly ## Impact **High** — This breaks automated release promotion workflows. Our CI pipeline promotes pre-releases to RC when a draft PR is opened to main. Since most PRs are created programmatically (via CLI tools, automation, Claude Code), the RC promotion step is completely bypassed. ### Affected repos All repos using the Universal Build & Release workflow (`auto-release.yml`) — currently 37+ repos across MokoConsulting. ## Environment - Gitea version: 1.26.1+397-g1e1441f8bd - Runners: act_runner nightly-dind-rootless (3 instances) ## Expected Behavior API-created PRs should fire the same `pull_request` webhook events as UI-created PRs, matching GitHub Actions behavior. ## Workaround Currently using `workflow_dispatch` as a manual fallback, but this defeats the purpose of the automated promotion pipeline. ## Related - MokoConsulting/moko-platform#155 (RC promotion feature) - MokoConsulting/MokoWaaS#48 (first repo to hit this)
jmiller added the ci-cdpriority: high labels 2026-05-26 19:01:14 +00:00
Author
Owner

Being worked on in a separate session.

Being worked on in a separate session.
Sign in to join this conversation.
No labels ci-cd priority: high
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#220