feat: add Gitea Actions support#1
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
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. |
There was a problem hiding this comment.
💡 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".
| const match = url.match(/^(?:(?:https?|ssh):\/\/)?(?:git@)?([^/:]+)[:/]([^/]+)\/([^/]+?)(?:\.git)?$/) | ||
| if (!match) return null |
There was a problem hiding this comment.
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 👍 / 👎.
| const isMock = Boolean(args.event || args.token) | ||
| const context = isMock ? (JSON.parse(args.event!) as Context) : github.context |
There was a problem hiding this comment.
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 👍 / 👎.
6bc5432 to
b0abff7
Compare
Summary
opencode gitea installandopencode gitea runCLI commands, mirroring the existing GitHub Actions integrationForgeProviderinterface) with shared types for Issue, PR, Comment, etc.GiteaForgeadapter using Gitea REST API (/api/v1) — no GraphQL, PAT auth, dynamic git hostparseRemote()to auto-detect GitHub vs Gitea from git remote URLsgitea/action.ymlfor use in.gitea/workflows/issue_comment,pull_request_review_comment,issues,pull_request,schedule,workflow_dispatchparseRemoteandGiteaForge(16 tests passing)devbranchKey differences from GitHub integration
GITEA_TOKEN)fetchto/api/v1(REST only)payload.issue.pull_request != nullpayload.is_pull === trueDELETE /installation/token