Skip to content

feat: add Gitea Actions support#1

Open
Svtter wants to merge 6 commits into
devfrom
feat/gitea-support
Open

feat: add Gitea Actions support#1
Svtter wants to merge 6 commits into
devfrom
feat/gitea-support

Conversation

@Svtter
Copy link
Copy Markdown
Owner

@Svtter Svtter commented Apr 9, 2026

Summary

  • Add opencode gitea install and opencode gitea run CLI commands, mirroring the existing GitHub Actions integration
  • Extract a platform abstraction layer (ForgeProvider interface) with shared types for Issue, PR, Comment, etc.
  • Implement GiteaForge adapter using Gitea REST API (/api/v1) — no GraphQL, PAT auth, dynamic git host
  • Add parseRemote() to auto-detect GitHub vs Gitea from git remote URLs
  • Add composite action gitea/action.yml for use in .gitea/workflows/
  • Support all event types: issue_comment, pull_request_review_comment, issues, pull_request, schedule, workflow_dispatch
  • Include reactions, branch management (local + fork PRs), PR creation, and session sharing
  • Add unit tests for parseRemote and GiteaForge (16 tests passing)
  • Based on latest upstream dev branch

Key differences from GitHub integration

GitHub Gitea
Auth OIDC → App token or PAT PAT only (GITEA_TOKEN)
API Octokit REST + GraphQL fetch to /api/v1 (REST only)
PR detection payload.issue.pull_request != null payload.is_pull === true
Token revocation DELETE /installation/token N/A (static PAT)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6bc5432b4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +27 to +28
const match = url.match(/^(?:(?:https?|ssh):\/\/)?(?:git@)?([^/:]+)[:/]([^/]+)\/([^/]+?)(?:\.git)?$/)
if (!match) return null
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse Gitea remotes with explicit ports

Update the Gitea remote parser to accept host:port forms, because the current regex only allows hosts without :. For remotes like https://gitea.example.com:3000/owner/repo.git or ssh://git@gitea.example.com:2222/owner/repo.git, parseRemote() returns null, and both gitea install and gitea run fail with "Could not find a Gitea git remote" despite a valid repository.

Useful? React with 👍 / 👎.

Comment on lines +288 to +289
const isMock = Boolean(args.event || args.token)
const context = isMock ? (JSON.parse(args.event!) as Context) : github.context
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse mock context only when an event payload is passed

Guard mock-context parsing on args.event specifically. Right now isMock becomes true when --token is provided, but context is still built via JSON.parse(args.event!); calling opencode gitea run --token ... therefore throws before using github.context, making the documented token override path unusable unless --event is also supplied.

Useful? React with 👍 / 👎.

@Svtter Svtter force-pushed the feat/gitea-support branch from 6bc5432 to b0abff7 Compare April 9, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant