openapi-mcp-server/docs/forgejo.md
Tom Foster 719d4ecba4
All checks were successful
CI / Lint & Test (push) Successful in 23s
CI / Build and push Docker image (push) Successful in 1m22s
Update endpoint paths and lint codebase
2025-08-01 21:37:26 +01:00

68 KiB

Forgejo Tool

The Forgejo tool provides a comprehensive set of functionalities to interact with Forgejo (and Gitea) instances, enabling powerful integrations for repository management, CI/CD automation, and issue tracking within your Multi-agent Conversation Platform.

Overview

This tool allows you to programmatically interact with Forgejo and Gitea servers. It provides endpoints to:

  • Retrieve server information (e.g. version).
  • Perform repository operations (list, search, read file content, list branches, list commits).
  • Interact with Forgejo Actions (list workflow runs, list jobs, get job logs).
  • Manage issues and pull requests (list, get details, list comments).
  • Retrieve user information and list user repositories.

Endpoints

Method Endpoint Description
GET /forgejo/version Get the version of the Forgejo/Gitea instance.
GET /forgejo/repos/search Search for repositories.
GET /forgejo/repos/{owner}/{repo}/branches List branches for a repository.
GET /forgejo/repos/{owner}/{repo}/contents/{filepath} List contents of a directory or read a file.
GET /forgejo/repos/{owner}/{repo}/raw/{filepath} Get raw file content.
GET /forgejo/repos/{owner}/{repo}/commits List commits for a repository.
GET /forgejo/repos/{owner}/{repo}/actions/tasks List workflow runs (tasks).
GET /forgejo/repos/{owner}/{repo}/actions/runs/{run_id}/jobs List jobs for a workflow run.
GET /forgejo/repos/{owner}/{repo}/actions/jobs/{job_id}/log Get job log.
GET /forgejo/repos/{owner}/{repo}/issues List issues for a repository.
GET /forgejo/repos/{owner}/{repo}/issues/{index} Get a specific issue.
GET /forgejo/repos/{owner}/{repo}/issues/{index}/comments List comments for an issue.
GET /forgejo/repos/{owner}/{repo}/pulls List pull requests for a repository.
GET /forgejo/repos/{owner}/{repo}/pulls/{index} Get a specific pull request.
GET /forgejo/repos/{owner}/{repo}/pulls/{index}/reviews List review comments for a pull request.
GET /forgejo/users/{username} Get user information.
GET /forgejo/users/{username}/repos List repositories owned by a user.

Usage

The Forgejo tool is automatically loaded by the OpenAPI MCP Server framework. All endpoints are available under the /forgejo prefix when the server is running. Visit /docs for interactive API documentation.

Authentication

Many Forgejo API endpoints require authentication. The Forgejo tool supports authentication via a personal access token.

  • Personal Access Token (PAT):
    • Generate a PAT in your Forgejo user settings.

    • Pass the PAT in the Authorization header of your requests as token YOUR_TOKEN.

      Authorization: token YOUR_TOKEN
      

Configuration

The Forgejo tool can be configured via environment variables or the config.yaml file.

Environment Variables

  • FORGEJO_BASE_URL: The base URL of your Forgejo or Gitea instance (e.g. https://git.example.com).
  • FORGEJO_API_KEY: Your personal access token for authentication.

config.yaml

You can also configure the Forgejo tool in your config.yaml file:

forgejo:
  base_url: "https://git.example.com"
  api_key: "your_forgejo_api_key"

Error Handling

The Forgejo API uses standard HTTP status codes to indicate the success or failure of a request.

  • 200 OK: The request was successful.
  • 400 Bad Request: The request was malformed or invalid.
  • 401 Unauthorized: Authentication is required or failed.
  • 403 Forbidden: The authenticated user does not have permission to access the resource.
  • 404 Not Found: The requested resource could not be found.
  • 500 Internal Server Error: An unexpected error occurred on the server.

Rate Limiting

Forgejo instances may implement rate limiting to prevent abuse. If you exceed the rate limit, the API will return a 429 Too Many Requests status code. The response headers will typically include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset to inform you about your current rate limit status.

Webhooks

Forgejo supports webhooks to notify external services of events such as pushes, pull requests, and issues. While the Forgejo tool itself does not directly manage webhooks, you can configure them within your Forgejo instance to send payloads to your openapi-mcp-server endpoints, allowing for event-driven automation.

To quickly check if you're interacting with a Forgejo or Gitea instance, you can use the version endpoint.

  • Endpoint: GET /api/v1/version

  • Description: This endpoint returns the version of the Gitea or Forgejo instance. A successful response confirms you're communicating with a compatible server.

  • Example Response:

    {"version":"11.0.2+gitea-1.22.0"}
    

Repository Operations

These endpoints handle repository-level actions.

  • List Repositories:

    • Endpoint: GET /api/v1/repos/search

    • Description: Searches for public repositories. Requires authentication to find private ones.

    • Example Response (no results):

      {"ok":true,"data":[]}
      
    • Example Response (with results):

      {"ok":true,"data":[{"id":5,"owner":{"id":1,"login":"tom","login_name":"","source_id":0,"full_name":"Tom Foster","email":"tom@tcpip.uk","avatar_url":"https://git.tomfos.tr/avatar/85ae33dbf19eb9108ad174abec8edd2e","html_url":"https://git.tomfos.tr/tom","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-04-16T11:19:23+01:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"he/him","website":"https://tomfos.tr","description":"Tech enthusiast with a flair for AI, automation, and FOSS. Skilled in Python, Linux, and server management. Passionate about sci-fi and futurism. 🛸","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"tom"},"name":"claude-code-commands","full_name":"tom/claude-code-commands","description":"Slash commands for CLI vibecoding clients like Claude Code","empty":false,"private":false,"fork":false,"template":false,"parent":null,"mirror":false,"size":45,"language":"","languages_url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/languages","html_url":"https://git.tomfos.tr/tom/claude-code-commands","url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands","link":"","ssh_url":"ssh://git@git.tomfos.tr/tom/claude-code-commands.git","clone_url":"https://git.tomfos.tr/tom/claude-code-commands.git","original_url":"","website":"","stars_count":0,"forks_count":0,"watchers_count":1,"open_issues_count":0,"open_pr_counter":0,"release_counter":0,"default_branch":"main","archived":false,"created_at":"2025-07-09T14:39:09+01:00","updated_at":"2025-07-09T19:05:02+01:00","archived_at":"1970-01-01T01:00:00Z","permissions":{"admin":false,"push":false,"pull":true},"has_issues":true,"internal_tracker":{"enable_time_tracker":false,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":false,"wiki_branch":"main","globally_editable_wiki":false,"has_pull_requests":true,"has_projects":false,"has_releases":false,"has_packages":true,"has_actions":true,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":true,"allow_rebase_update":true,"default_delete_branch_after_merge":false,"default_merge_style":"fast-forward-only","default_allow_maintainer_edit":false,"default_update_style":"merge","avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","repo_transfer":null,"topics":null}]}
      
  • List Branches:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/branches

    • Description: Returns a list of all branches for a specified repository.

    • Example Response:

      [{"name":"main","commit":{"id":"92e810e3a1a821151032982cfd4ff59dd2282c7c","message":"Python project framework\n","url":"https://git.tomfos.tr/tom/claude-code-commands/commit/92e810e3a1a821151032982cfd4ff59dd2282c7c","author":{"name":"Tom Foster","email":"tom@tcpip.uk","username":"tom"},"committer":{"name":"Tom Foster","email":"tom@tcpip.uk","username":"tom"},"verification":{"verified":false,"reason":"gpg.error.not_signed_commit","signature":"","signer":null,"payload":""},"timestamp":"2025-07-09T19:04:55+01:00","added":null,"removed":null,"modified":null},"protected":false,"required_approvals":0,"enable_status_check":false,"status_check_contexts":[],"user_can_push":false,"user_can_merge":false,"effective_branch_protection_name":""}]
      
  • List Files in a Directory:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/contents/{filepath}

    • Description: Lists the contents of a directory at the given {filepath}. If {filepath} is omitted, it defaults to the root of the repository's default branch. You can specify a branch or commit SHA using the ref query parameter.

    • Example Response (listing root directory):

      [{"name":"LICENSE","path":"LICENSE","sha":"81066de8eaa2a5720f8f1be0d3816adbfce84c95","last_commit_sha":"4522e4b77c36dc2bae021c6563818f5290498685","type":"file","size":9199,"encoding":null,"content":null,"target":null,"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/LICENSE?ref=main","html_url":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/LICENSE","git_url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/81066de8eaa2a5720f8f1be0d3816adbfce84c95","download_url":"https://git.tomfos.tr/tom/claude-code-commands/raw/branch/main/LICENSE","submodule_git_url":null,"_links":{"self":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/LICENSE?ref=main","git":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/81066de8eaa2a5720f8f1be0d3816adbfce84c95","html":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/LICENSE"}},{"name":"README.md","path":"README.md","sha":"9ddb05e53a7f2ac2e91b9eb2923405a28618f2f5","last_commit_sha":"4522e4b77c36dc2bae021c6563818f5290498685","type":"file","size":1841,"encoding":null,"content":null,"target":null,"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/README.md?ref=main","html_url":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/README.md","git_url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/9ddb05e53a7f2ac2e91b9eb2923405a28618f2f5","download_url":"https://git.tomfos.tr/tom/claude-code-commands/raw/branch/main/README.md","submodule_git_url":null,"_links":{"self":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/README.md?ref=main","git":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/9ddb05e53a7f2ac2e91b9eb2923405a28618f2f5","html":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/README.md"}},{"name":"framework.md","path":"framework.md","sha":"f9f327aeb2fcaac243b51761d6cca21bc352bcd7","last_commit_sha":"92e810e3a1a821151032982cfd4ff59dd2282c7c","type":"file","size":13341,"encoding":null,"content":null,"target":null,"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/framework.md?ref=main","html_url":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/framework.md","git_url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/f9f327aeb2fcaac243b51761d6cca21bc352bcd7","download_url":"https://git.tomfos.tr/tom/claude-code-commands/raw/branch/main/framework.md","submodule_git_url":null,"_links":{"self":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/framework.md?ref=main","git":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/f9f327aeb2fcaac243b51761d6cca21bc352bcd7","html":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/framework.md"}},{"name":"review-docstrings.md","path":"review-docstrings.md","sha":"09a629c49b4ae8c2c8dfd4b714eb54ac549e8fea","last_commit_sha":"4522e4b77c36dc2bae021c6563818f5290498685","type":"file","size":2297,"encoding":null,"content":null,"target":null,"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/review-docstrings.md?ref=main","html_url":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/review-docstrings.md","git_url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/09a629c49b4ae8c2c8dfd4b714eb54ac549e8fea","download_url":"https://git.tomfos.tr/tom/claude-code-commands/raw/branch/main/review-docstrings.md","submodule_git_url":null,"_links":{"self":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/review-docstrings.md?ref=main","git":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/09a629c49b4ae8c2c8dfd4b714eb54ac549e8fea","html":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/review-docstrings.md"}},{"name":"uv-linting.md","path":"uv-linting.md","sha":"e7c75a6eff8e2b1c3da5821d8501bd5c7a15acf5","last_commit_sha":"4522e4b77c36dc2bae021c6563818f5290498685","type":"file","size":2631,"encoding":null,"content":null,"target":null,"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/uv-linting.md?ref=main","html_url":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/uv-linting.md","git_url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/e7c75a6eff8e2b1c3da5821d8501bd5c7a15acf5","download_url":"https://git.tomfos.tr/tom/claude-code-commands/raw/branch/main/uv-linting.md","submodule_git_url":null,"_links":{"self":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/uv-linting.md?ref=main","git":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/e7c75a6eff8e2b1c3da5821d8501bd5c7a15acf5","html":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/uv-linting.md"}}]
      
  • Read a File:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/contents/{filepath}

    • Description: Retrieves the contents of a single file. The response will be a JSON object containing the file's content, typically Base64 encoded.

    • Example Response:

      {"name":"README.md","path":"README.md","sha":"9ddb05e53a7f2ac2e91b9eb2923405a28618f2f5","last_commit_sha":"4522e4b77c36dc2bae021c6563818f5290498685","type":"file","size":1841,"encoding":"base64","content":"IyBDbGF1ZGUgQ29kZSBDb21tYW5kcyAKCioqU2xhc2ggY29tbWFuZHMgZm9yIENMSSB2aWJlY29kaW5nIGNsaWVudHMgbGlrZSBDbGF1ZGUgQ29kZS4qKgogClRoaXMgcmVwb3NpdG9yeSBjb250YWlucyBhIGNvbGxlY3Rpb24gb2Ygc2xhc2ggY29tbWFuZHMgdG8gZW5oYW5jZSB5b3VyIGV4cGVyaWVuY2Ugd2l0aCBDTEktYmFzZWQgCmNvZGluZyBhc3Npc3RhbnRzIGxpa2UgQ2xhdWRlIENvZGUuCgoxLiBbQ29tcGF0aWJpbGl0eV0oI2NvbXBhdGliaWxpdHkpCjIuIFtTZXR1cF0oI3NldHVwKQozLiBbVXNhZ2VdKCN1c2FnZSkKNC4gW0NvbnRyaWJ1dGluZ10oI2NvbnRyaWJ1dGluZykKNS4gW0xpY2Vuc2VdKCNsaWNlbnNlKQoKIyMgQ29tcGF0aWJpbGl0eQoKVGhlc2UgY29tbWFuZHMgYXJlIGRlc2lnbmVkIHRvIGJlIGNvbXBhdGlibGUgd2l0aCBhbnkgVFVJICJ2aWJlIGNvZGluZyIgdG9vbCB0aGF0IHN1cHBvcnRzIGxvYWRpbmcKY29tbWFuZHMgZnJvbSBNYXJrZG93biBmaWxlcywgc3VjaCBhcyBDbGF1ZGUgQ29kZS4KCioqTm90ZToqKiBBcyBvZiB0aGUgdGltZSBvZiB3cml0aW5nLCB0aGUgR2VtaW5pIENMSSBkb2VzIG5vdCBoYXZlIGEgc2ltaWxhciBzbGFzaCBjb21tYW5kIGZlYXR1cmUuCgojIyBTZXR1cAoKMS4gKipGb3JrIHRoaXMgcmVwb3NpdG9yeSoqIHRvIHlvdXIgb3duIEdpdCBhY2NvdW50LgoyLiAqKkNsb25lIHlvdXIgZm9ya2VkIHJlcG9zaXRvcnkqKiB0byBgfi8uY2xhdWRlL2NvbW1hbmRzYCBvbiB5b3VyIGxvY2FsIG1hY2hpbmUsIGUuZy4KCiAgICBgYGBiYXNoCiAgICBnaXQgY2xvbmUgc3NoOi8vZ2l0QGdpdC50b21mb3MudHIvdG9tL2NsYXVkZS1jb21tYW5kcy5naXQgfi8uY2xhdWRlL2NvbW1hbmRzCiAgICBgYGAKICAgIFRoaXMgYWxsb3dzIHlvdSB0byBoYXZlIHlvdXIgb3duIHZlcnNpb25lZCBjb3B5IG9mIHRoZSBjb21tYW5kcyBhbmQgY3VzdG9taXNlIHRoZW0gYXMgeW91IHdpc2guCgojIyBVc2FnZQoKRWFjaCBNYXJrZG93biBmaWxlIChgLm1kYCkgaW4gdGhpcyBkaXJlY3RvcnkgYmVjb21lcyBhIHNsYXNoIGNvbW1hbmQgYXZhaWxhYmxlIGluIHlvdXIgQ0xJIGNvZGluZwphc3Npc3RhbnQuIFRoZSBmaWxlbmFtZSBkZXRlcm1pbmVzIHRoZSBjb21tYW5kIG5hbWUuCgpGb3IgZXhhbXBsZSwgYSBmaWxlIG5hbWVkIGB3cml0ZS1kb2NzLm1kYCB3aWxsIGNyZWF0ZSBhIGAvd3JpdGUtZG9jc2AgY29tbWFuZC4KClRvIGNyZWF0ZSBhIG5ldyBjb21tYW5kLCBzaW1wbHkgYWRkIGEgbmV3IE1hcmtkb3duIGZpbGUgdG8gdGhpcyBkaXJlY3RvcnkuCgojIyBDb250cmlidXRpbmcKCkNvbnRyaWJ1dGlvbnMgYXJlIHdlbGNvbWUhIElmIHlvdSB3b3VsZCBsaWtlIHRvIGFkZCB5b3VyIG93biBzbGFzaCBjb21tYW5kcyBvciBpbXByb3ZlIGV4aXN0aW5nCm9uZXMsIHBsZWFzZSBmb2xsb3cgdGhlc2Ugc3RlcHM6CgoxLiBGb3JrIHRoZSByZXBvc2l0b3J5LgoyLiBDcmVhdGUgYSBuZXcgYnJhbmNoIGZvciB5b3VyIGZlYXR1cmUgb3IgYnVnIGZpeC4KMy4gQWRkIHlvdXIgY2hhbmdlcyBhbmQgY29tbWl0IHRoZW0gd2l0aCBhIGRlc2NyaXB0aXZlIG1lc3NhZ2UuCjQuIFB1c2ggeW91ciBjaGFuZ2VzIHRvIHlvdXIgZm9ya2VkIHJlcG9zaXRvcnkuCjUuIENyZWF0ZSBhIHB1bGwgcmVxdWVzdCB0byB0aGUgbWFpbiByZXBvc2l0b3J5LgoKUGxlYXNlIG1ha2Ugc3VyZSB5b3VyIGNvZGUgYWRoZXJlcyB0byB0aGUgcHJvamVjdCdzIGNvZGluZyBzdGFuZGFyZHMuCgojIyBMaWNlbnNlCgpUaGlzIHByb2plY3QgaXMgbGljZW5zZWQgdW5kZXIgdGhlIFtBcGFjaGUgTGljZW5zZSAyLjBdKExJQ0VOU0UpLgo=","target":null,"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/README.md?ref=main","html_url":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/README.md","git_url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/9ddb05e53a7f2ac2e91b9eb2923405a28618f2f5","download_url":"https://git.tomfos.tr/tom/claude-code-commands/raw/branch/main/README.md","submodule_git_url":null,"_links":{"self":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/contents/README.md?ref=main","git":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/blobs/9ddb05e53a7f2ac2e91b9eb2923405a28618f2f5","html":"https://git.tomfos.tr/tom/claude-code-commands/src/branch/main/README.md"}}
      
  • Get a Raw File from a Repository:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/raw/{filepath}

    • Description: Retrieves the raw content of a file directly from the repository. This endpoint is useful for fetching file contents without the additional JSON metadata, potentially offering better efficiency for large files.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response (for a text file):

      This is the raw content of the file.
      It can be any text or binary data.
      
    • Example Response (for a binary file, e.g. an image):

      [Binary content of the image file]
      
  • List Commits:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/commits

    • Description: Fetches the commit history. Use the sha query parameter to specify a branch.

    • Example Response:

      [{"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/commits/92e810e3a1a821151032982cfd4ff59dd2282c7c","sha":"92e810e3a1a821151032982cfd4ff59dd2282c7c","created":"2025-07-09T19:04:55+01:00","html_url":"https://git.tomfos.tr/tom/claude-code-commands/commit/92e810e3a1a821151032982cfd4ff59dd2282c7c","commit":{"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/commits/92e810e3a1a821151032982cfd4ff59dd2282c7c","author":{"name":"Tom Foster","email":"tom@tcpip.uk","date":"2025-07-09T19:04:55+01:00"},"committer":{"name":"Tom Foster","email":"tom@tcpip.uk","date":"2025-07-09T19:04:55+01:00"},"message":"Python project framework\n","tree":{"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/trees/92e810e3a1a821151032982cfd4ff59dd2282c7c","sha":"92e810e3a1a821151032982cfd4ff59dd2282c7c","created":"2025-07-09T19:04:55+01:00"},"verification":{"verified":false,"reason":"gpg.error.not_signed_commit","signature":"","signer":null,"payload":""}},"author":{"id":1,"login":"tom","login_name":"","source_id":0,"full_name":"Tom Foster","email":"tom@noreply.localhost","avatar_url":"https://git.tomfos.tr/avatar/85ae33dbf19eb9108ad174abec8edd2e","html_url":"https://git.tomfos.tr/tom","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-04-16T11:19:23+01:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"he/him","website":"https://tomfos.tr","description":"Tech enthusiast with a flair for AI, automation, and FOSS. Skilled in Python, Linux, and server management. Passionate about sci-fi and futurism. 🛸","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"tom"},"committer":{"id":1,"login":"tom","login_name":"","source_id":0,"full_name":"Tom Foster","email":"tom@noreply.localhost","avatar_url":"https://git.tomfos.tr/avatar/85ae33dbf19eb9108ad174abec8edd2e","html_url":"https://git.tomfos.tr/tom","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-04-16T11:19:23+01:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"he/him","website":"https://tomfos.tr","description":"Tech enthusiast with a flair for AI, automation, and FOSS. Skilled in Python, Linux, and server management. Passionate about sci-fi and futurism. 🛸","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"tom"},"parents":[{"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/commits/4522e4b77c36dc2bae021c6563818f5290498685","sha":"4522e4b77c36dc2bae021c6563818f5290498685","created":"0001-01-01T00:00:00Z"}],"files":[{"filename":"framework.md","status":"added"}],"stats":{"total":379,"additions":379,"deletions":0}},{"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/commits/4522e4b77c36dc2bae021c6563818f5290498685","sha":"4522e4b77c36dc2bae021c6563818f5290498685","created":"2025-07-09T15:23:12+01:00","html_url":"https://git.tomfos.tr/tom/claude-code-commands/commit/4522e4b77c36dc2bae021c6563818f5290498685","commit":{"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/commits/4522e4b77c36dc2bae021c6563818f5290498685","author":{"name":"Tom Foster","email":"tom@tcpip.uk","date":"2025-07-09T15:23:12+01:00"},"committer":{"name":"Tom Foster","email":"tom@tcpip.uk","date":"2025-07-09T15:23:12+01:00"},"message":"Initial commit\n","tree":{"url":"https://git.tomfos.tr/api/v1/repos/tom/claude-code-commands/git/trees/4522e4b77c36dc2bae021c6563818f5290498685","sha":"4522e4b77c36dc2bae021c6563818f5290498685","created":"2025-07-09T15:23:12+01:00"},"verification":{"verified":false,"reason":"gpg.error.not_signed_commit","signature":"","signer":null,"payload":""}},"author":{"id":1,"login":"tom","login_name":"","source_id":0,"full_name":"Tom Foster","email":"tom@noreply.localhost","avatar_url":"https://git.tomfos.tr/avatar/85ae33dbf19eb9108ad174abec8edd2e","html_url":"https://git.tomfos.tr/tom","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-04-16T11:19:23+01:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"he/him","website":"https://tomfos.tr","description":"Tech enthusiast with a flair for AI, automation, and FOSS. Skilled in Python, Linux, and server management. Passionate about sci-fi and futurism. 🛸","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"tom"},"committer":{"id":1,"login":"tom","login_name":"","source_id":0,"full_name":"Tom Foster","email":"tom@noreply.localhost","avatar_url":"https://git.tomfos.tr/avatar/85ae33dbf19eb9108ad174abec8edd2e","html_url":"https://git.tomfos.tr/tom","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-04-16T11:19:23+01:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"he/him","website":"https://tomfos.tr","description":"Tech enthusiast with a flair for AI, automation, and FOSS. Skilled in Python, Linux, and server management. Passionate about sci-fi and futurism. 🛸","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"tom"},"parents":[],"files":[{"filename":"LICENSE","status":"added"},{"filename":"README.md","status":"added"},{"filename":"review-docstrings.md","status":"added"},{"filename":"uv-linting.md","status":"added"}],"stats":{"total":297,"additions":297,"deletions":0}}]
      

Actions (CI/CD)

These endpoints are for interacting with Forgejo Actions.

  • List Workflow Runs:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/actions/tasks

    • Description: Returns a list of workflow runs (tasks) for a repository.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      [
        {
          "created_at": "2025-07-10T10:00:00Z",
          "display_title": "Build and Test",
          "event": "push",
          "head_branch": "main",
          "head_sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
          "id": 1,
          "name": "Build",
          "run_number": 1,
          "run_started_at": "2025-07-10T10:00:00Z",
          "status": "completed",
          "updated_at": "2025-07-10T10:05:00Z",
          "url": "https://git.tomfos.tr/api/v1/repos/owner/repo/actions/tasks/1",
          "workflow_id": "workflow.yml"
        }
      ]
      
  • List Workflow Jobs:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/actions/runs/{run_id}/jobs

    • Description: Lists all jobs for a specific workflow run. This endpoint requires authentication.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      {
        "total_count": 2,
        "jobs": [
          {
            "id": 1234567890,
            "run_id": 9876543210,
            "run_url": "https://forgejo.example.com/api/v1/repos/octocat/example-repo/actions/runs/9876543210",
            "node_id": "MDg6Q2hlY2tSdW5Kb2IxMjM0NTY3ODkw",
            "head_sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
            "url": "https://forgejo.example.com/api/v1/repos/octocat/example-repo/actions/jobs/1234567890",
            "html_url": "https://forgejo.example.com/octocat/example-repo/actions/runs/9876543210/jobs/1234567890",
            "status": "completed",
            "conclusion": "success",
            "started_at": "2023-01-15T10:00:00Z",
            "completed_at": "2023-01-15T10:05:30Z",
            "name": "build",
            "steps": [
              {
                "name": "Checkout",
                "status": "completed",
                "conclusion": "success",
                "number": 1,
                "started_at": "2023-01-15T10:00:05Z",
                "completed_at": "2023-01-15T10:00:15Z"
              },
              {
                "name": "Run tests",
                "status": "completed",
                "conclusion": "success",
                "number": 2,
                "started_at": "2023-01-15T10:00:20Z",
                "completed_at": "2023-01-15T10:05:00Z"
              }
            ],
            "runner_id": 1,
            "runner_name": "Forgejo Runner 1",
            "runner_group_id": 1,
            "runner_group_name": "Default"
          },
          {
            "id": 1234567891,
            "run_id": 9876543210,
            "run_url": "https://forgejo.example.com/api/v1/repos/octocat/example-repo/actions/runs/9876543210",
            "node_id": "MDg6Q2hlY2tSdW5Kb2IxMjM0NTY3ODkx",
            "head_sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
            "url": "https://forgejo.example.com/api/v1/repos/octocat/example-repo/actions/jobs/1234567891",
            "html_url": "https://forgejo.example.com/octocat/example-repo/actions/runs/9876543210/jobs/1234567891",
            "status": "completed",
            "conclusion": "skipped",
            "started_at": "2023-01-15T10:06:00Z",
            "completed_at": "2023-01-15T10:06:05Z",
            "name": "deploy",
            "steps": [
              {
                "name": "Deploy to production",
                "status": "completed",
                "conclusion": "skipped",
                "number": 1,
                "started_at": "2023-01-15T10:06:00Z",
                "completed_at": "2023-01-15T10:06:05Z"
              }
            ],
            "runner_id": null,
            "runner_name": null,
            "runner_group_id": null,
            "runner_group_name": null
          }
        ]
      }
      
  • Get Job Log:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/actions/jobs/{job_id}/log

    • Description: Downloads the raw text log file for a specific job. This endpoint requires authentication.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      {
        "log_content": "2023-10-27T10:00:00.123Z: Starting job 'build'\n2023-10-27T10:00:01.456Z: Running step 'Checkout repository'\n2023-10-27T10:00:02.789Z: Successfully checked out branch 'main'\n2023-10-27T10:00:03.111Z: Running step 'Install dependencies'\n...\n2023-10-27T10:05:30.999Z: Job 'build' completed successfully."
      }
      

Issues and Pull Requests

These endpoints help manage issues and pull requests.

  • List Issues:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/issues

    • Description: Retrieves a list of issues. Filter by state (open, closed) using the state query parameter.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      [
        {
          "assignee": {
            "active": true,
            "avatar_url": "string",
            "created": "2023-07-04T08:50:30.796Z",
            "description": "string",
            "email": "string",
            "followers_count": 0,
            "following_count": 0,
            "full_name": "string",
            "id": 0,
            "is_admin": true,
            "language": "string",
            "last_login": "2023-07-04T08:50:30.796Z",
            "location": "string",
            "login": "string",
            "name": "string",
            "prohibit_login": true,
            "restricted": true,
            "starred_repos_count": 0,
            "visibility": "public",
            "website": "string"
          },
          "assignees": [
            {
              "active": true,
              "avatar_url": "string",
              "created": "2023-07-04T08:50:30.796Z",
              "description": "string",
              "email": "string",
              "followers_count": 0,
              "following_count": 0,
              "full_name": "string",
              "id": 0,
              "is_admin": true,
              "language": "string",
              "last_login": "2023-07-04T08:50:30.796Z",
              "location": "string",
              "login": "string",
              "name": "string",
              "prohibit_login": true,
              "restricted": true,
              "starred_repos_count": 0,
              "visibility": "public",
              "website": "string"
            }
          ],
          "body": "string",
          "closed_at": "2023-07-04T08:50:30.796Z",
          "comments": 0,
          "created_at": "2023-07-04T08:50:30.796Z",
          "due_date": "2023-07-04T08:50:30.796Z",
          "id": 0,
          "is_locked": true,
          "labels": [
            {
              "color": "string",
              "description": "string",
              "id": 0,
              "name": "string",
              "url": "string"
            }
          ],
          "milestone": {
            "closed_at": "2023-07-04T08:50:30.796Z",
            "closed_issues": 0,
            "created_at": "2023-07-04T08:50:30.796Z",
            "description": "string",
            "due_on": "2023-07-04T08:50:30.796Z",
            "id": 0,
            "open_issues": 0,
            "state": "open",
            "title": "string",
            "updated_at": "2023-07-04T08:50:30.796Z"
          },
          "original_author": "string",
          "original_author_id": 0,
          "pin_order": 0,
          "pull_request": {
            "merged": true,
            "merged_at": "2023-07-04T08:50:30.796Z"
          },
          "ref": "string",
          "repository": {
            "allow_manual_merge": true,
            "allow_merge_commits": true,
            "allow_rebase": true,
            "allow_rebase_merge": true,
            "allow_squash_merge": true,
            "archived": true,
            "avatar_url": "string",
            "clone_url": "string",
            "created_at": "2023-07-04T08:50:30.796Z",
            "default_branch": "string",
            "description": "string",
            "empty_repo": true,
            "external_tracker": {
              "external_tracker_url": "string",
              "new_issue_url": "string",
              "open_issues_count": 0
            },
            "external_wiki": {
              "external_wiki_url": "string"
            },
            "fork": true,
            "forks_count": 0,
            "full_name": "string",
            "has_actions": true,
            "has_issues": true,
            "has_packages": true,
            "has_projects": true,
            "has_pull_requests": true,
            "has_releases": true,
            "has_wiki": true,
            "html_url": "string",
            "id": 0,
            "ignore_whitespace_conflicts": true,
            "internal": true,
            "language": "string",
            "languages_url": "string",
            "mirror": true,
            "mirror_interval": "string",
            "mirror_updated": "2023-07-04T08:50:30.796Z",
            "name": "string",
            "open_issues_count": 0,
            "open_pr_counter": 0,
            "owner": {
              "active": true,
              "avatar_url": "string",
              "created": "2023-07-04T08:50:30.796Z",
              "description": "string",
              "email": "string",
              "followers_count": 0,
              "following_count": 0,
              "full_name": "string",
              "id": 0,
              "is_admin": true,
              "language": "string",
              "last_login": "2023-07-04T08:50:30.796Z",
              "location": "string",
              "login": "string",
              "name": "string",
              "prohibit_login": true,
              "restricted": true,
              "starred_repos_count": 0,
              "visibility": "public",
              "website": "string"
            },
            "private": true,
            "projects_count": 0,
            "pushed_at": "2023-07-04T08:50:30.796Z",
            "release_counter": 0,
            "repo_transfer": {
              "doer": {
                "active": true,
                "avatar_url": "string",
                "created": "2023-07-04T08:50:30.796Z",
                "description": "string",
                "email": "string",
                "followers_count": 0,
                "following_count": 0,
                "full_name": "string",
                "id": 0,
                "is_admin": true,
                "language": "string",
                "last_login": "2023-07-04T08:50:30.796Z",
                "location": "string",
                "login": "string",
                "name": "string",
                "prohibit_login": true,
                "restricted": true,
                "starred_repos_count": 0,
                "visibility": "public",
                "website": "string"
              },
              "recipient": {
                "active": true,
                "avatar_url": "string",
                "created": "2023-07-04T08:50:30.796Z",
                "description": "string",
                "email": "string",
                "followers_count": 0,
                "following_count": 0,
                "full_name": "string",
                "id": 0,
                "is_admin": true,
                "language": "string",
                "last_login": "2023-07-04T08:50:30.796Z",
                "location": "string",
                "login": "string",
                "name": "string",
                "prohibit_login": true,
                "restricted": true,
                "starred_repos_count": 0,
                "visibility": "public",
                "website": "string"
              }
            },
            "size": 0,
            "ssh_url": "string",
            "stars_count": 0,
            "status": "string",
            "subscribers_count": 0,
            "template": true,
            "topics": [
              "string"
            ],
            "updated_at": "2023-07-04T08:50:30.796Z",
            "watchers_count": 0,
            "website": "string"
          },
          "state": "open",
          "title": "string",
          "updated_at": "2023-07-04T08:50:30.796Z",
          "url": "string",
          "user": {
            "active": true,
            "avatar_url": "string",
            "created": "2023-07-04T08:50:30.796Z",
            "description": "string",
            "email": "string",
            "followers_count": 0,
            "following_count": 0,
            "full_name": "string",
            "id": 0,
            "is_admin": true,
            "language": "string",
            "last_login": "2023-07-04T08:50:30.796Z",
            "location": "string",
            "login": "string",
            "name": "string",
            "prohibit_login": true,
            "restricted": true,
            "starred_repos_count": 0,
            "visibility": "public",
            "website": "string"
          }
        }
      ]
      
  • Get a Specific Issue:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/issues/{index}

    • Description: Gets detailed information for a single issue.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      {
        "id": 123,
        "url": "https://forgejo.example.com/api/v1/repos/octocat/hello-world/issues/123",
        "html_url": "https://forgejo.example.com/octocat/hello-world/issues/123",
        "index": 123,
        "poster_id": 456,
        "original_author": "octocat",
        "original_author_id": 456,
        "title": "Bug: Application crashes on startup",
        "body": "The application consistently crashes when launched on Windows 10. See attached logs for details.",
        "labels": [
          {
            "id": 1,
            "name": "bug",
            "color": "d73a4a",
            "description": "Something isn't working"
          },
          {
            "id": 2,
            "name": "priority: high",
            "color": "b60205",
            "description": "High priority issue"
          }
        ],
        "milestone": {
          "id": 1,
          "title": "Version 1.0 Release",
          "description": "Features and fixes for the 1.0 release",
          "state": "open",
          "due_on": "2025-12-31T23:59:59Z"
        },
        "assignee": {
          "id": 789,
          "login": "devuser",
          "full_name": "Developer User",
          "email": "devuser@example.com",
          "avatar_url": "https://forgejo.example.com/avatars/devuser",
          "last_login": "2025-07-09T10:00:00Z",
          "created": "2024-01-15T09:00:00Z",
          "is_admin": false,
          "restricted": false,
          "active": true,
          "prohibit_login": false,
          "location": "Remote",
          "website": "",
          "description": "",
          "visibility": "public",
          "followers_count": 5,
          "following_count": 2,
          "starred_repos_count": 10,
          "username": "devuser"
        },
        "assignees": [
          {
            "id": 789,
            "login": "devuser",
            "full_name": "Developer User",
            "email": "devuser@example.com",
            "avatar_url": "https://forgejo.example.com/avatars/devuser",
            "last_login": "2025-07-09T10:00:00Z",
            "created": "2024-01-15T09:00:00Z",
            "is_admin": false,
            "restricted": false,
            "active": true,
            "prohibit_login": false,
            "location": "Remote",
            "website": "",
            "description": "",
            "visibility": "public",
            "followers_count": 5,
            "following_count": 2,
            "starred_repos_count": 10,
            "username": "devuser"
          }
        ],
        "state": "open",
        "is_locked": false,
        "comments": 5,
        "created_at": "2025-07-01T10:30:00Z",
        "updated_at": "2025-07-09T14:15:00Z",
        "closed_at": null,
        "due_date": null,
        "pull_request": null
      }
      
  • List Issue Comments:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/issues/{index}/comments

    • Description: Fetches all comments for a specific issue.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      [
        {
          "body": "This is the first comment on the issue.",
          "created_at": "2019-08-24T14:15:22Z",
          "html_url": "https://forgejo.example.com/owner/repo/issues/1/comments/1",
          "id": 1,
          "issue_url": "https://forgejo.example.com/owner/repo/issues/1",
          "original_author": "user1",
          "original_author_id": 123,
          "pull_request_url": "",
          "updated_at": "2019-08-24T14:15:22Z",
          "user": {
            "active": true,
            "avatar_url": "https://forgejo.example.com/avatars/user1",
            "created": "2019-01-01T10:00:00Z",
            "description": "A sample user",
            "email": "user1@example.com",
            "followers_count": 5,
            "following_count": 2,
            "full_name": "User One",
            "id": 123,
            "is_admin": false,
            "language": "en-US",
            "last_login": "2025-07-10T10:00:00Z",
            "location": "Earth",
            "login": "user1",
            "prohibit_login": false,
            "restricted": false,
            "starred_repos_count": 10,
            "visibility": "public"
          }
        },
        {
          "body": "Another comment here.",
          "created_at": "2019-08-25T10:00:00Z",
          "html_url": "https://forgejo.example.com/owner/repo/issues/1/comments/2",
          "id": 2,
          "issue_url": "https://forgejo.example.com/owner/repo/issues/1",
          "original_author": "user2",
          "original_author_id": 456,
          "pull_request_url": "",
          "updated_at": "2019-08-25T10:00:00Z",
          "user": {
            "active": true,
            "avatar_url": "https://forgejo.example.com/avatars/user2",
            "created": "2019-02-01T11:00:00Z",
            "description": "Another sample user",
            "email": "user2@example.com",
            "followers_count": 3,
            "following_count": 1,
            "full_name": "User Two",
            "id": 456,
            "is_admin": false,
            "language": "en-US",
            "last_login": "2025-07-10T11:00:00Z",
            "location": "Mars",
            "login": "user2",
            "prohibit_login": false,
            "restricted": false,
            "starred_repos_count": 5,
            "visibility": "public"
          }
        }
      ]
      
  • List Pull Requests:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/pulls

    • Description: Retrieves a list of pull requests. Filter by state (open, closed) using the state query parameter.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      [
        {
          "id": 1,
          "url": "https://git.example.com/api/v1/repos/owner/repo/pulls/1",
          "number": 1,
          "user": {
            "id": 101,
            "login": "user1",
            "full_name": "User One",
            "email": "user1@example.com",
            "avatar_url": "https://git.example.com/avatars/user1",
            "created_at": "2023-01-01T10:00:00Z",
            "updated_at": "2023-01-01T10:00:00Z",
            "is_admin": false,
            "last_login": "2024-07-09T14:30:00Z",
            "prohibit_login": false,
            "restricted": false,
            "active": true,
            "location": "Earth",
            "website": "https://user1.example.com",
            "description": "A test user",
            "followers_count": 5,
            "following_count": 3,
            "starred_repos_count": 10,
            "visibility": "public"
          },
          "title": "Feature: Implement new authentication module",
          "body": "This pull request introduces a new authentication module using OAuth2.",
          "labels": [
            {
              "id": 1,
              "name": "feature",
              "color": "0052cc",
              "description": "New feature development",
              "url": "https://git.example.com/api/v1/repos/owner/repo/labels/1"
            },
            {
              "id": 2,
              "name": "backend",
              "color": "ededed",
              "description": "Backend related changes",
              "url": "https://git.example.com/api/v1/repos/owner/repo/labels/2"
            }
          ],
          "milestone": {
            "id": 1,
            "title": "Version 1.0 Release",
            "description": "All features for the 1.0 release",
            "state": "open",
            "open_issues": 2,
            "closed_issues": 8,
            "created_at": "2023-01-15T09:00:00Z",
            "updated_at": "2024-06-01T11:00:00Z",
            "due_on": "2024-07-31T23:59:59Z"
          },
          "assignee": {
            "id": 102,
            "login": "user2",
            "full_name": "User Two",
            "email": "user2@example.com",
            "avatar_url": "https://git.example.com/avatars/user2",
            "created_at": "2023-01-02T11:00:00Z",
            "updated_at": "2023-01-02T11:00:00Z",
            "is_admin": false,
            "last_login": "2024-07-09T14:35:00Z",
            "prohibit_login": false,
            "restricted": false,
            "active": true,
            "location": "Mars",
            "website": "https://user2.example.com",
            "description": "Another test user",
            "followers_count": 2,
            "following_count": 1,
            "starred_repos_count": 5,
            "visibility": "public"
          },
          "assignees": [
            {
              "id": 102,
              "login": "user2",
              "full_name": "User Two",
              "email": "user2@example.com",
              "avatar_url": "https://git.example.com/avatars/user2",
              "created_at": "2023-01-02T11:00:00Z",
              "updated_at": "2023-01-02T11:00:00Z",
              "is_admin": false,
              "last_login": "2024-07-09T14:35:00Z",
              "prohibit_login": false,
              "restricted": false,
              "active": true,
              "location": "Mars",
              "website": "https://user2.example.com",
              "description": "Another test user",
              "followers_count": 2,
              "following_count": 1,
              "starred_repos_count": 5,
              "visibility": "public"
            }
          ],
          "state": "open",
          "is_locked": false,
          "comments": 5,
          "created_at": "2024-07-01T08:00:00Z",
          "updated_at": "2024-07-09T14:00:00Z",
          "closed_at": null,
          "merged_at": null,
          "merged_commit_id": "",
          "head": {
            "label": "user1:feature/auth",
            "ref": "feature/auth",
            "sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
            "repo_id": 123,
            "repository": {
              "id": 123,
              "owner": {
                "id": 101,
                "login": "user1",
                "full_name": "User One",
                "email": "user1@example.com",
                "avatar_url": "https://git.example.com/avatars/user1",
                "created_at": "2023-01-01T10:00:00Z",
                "updated_at": "2023-01-01T10:00:00Z",
                "is_admin": false,
                "last_login": "2024-07-09T14:30:00Z",
                "prohibit_login": false,
                "restricted": false,
                "active": true,
                "location": "Earth",
                "website": "https://user1.example.com",
                "description": "A test user",
                "followers_count": 5,
                "following_count": 3,
                "starred_repos_count": 10,
                "visibility": "public"
              },
              "name": "repo",
              "full_name": "user1/repo",
              "description": "A sample repository",
              "private": false,
              "fork": false,
              "empty": false,
              "parent": null,
              "mirror": false,
              "size": 1024,
              "html_url": "https://git.example.com/user1/repo",
              "ssh_url": "git@git.example.com:user1/repo.git",
              "clone_url": "https://git.example.com/user1/repo.git",
              "website": "",
              "stars_count": 5,
              "forks_count": 2,
              "watchers_count": 3,
              "open_issues_count": 1,
              "open_pr_counter": 1,
              "release_counter": 0,
              "default_branch": "main",
              "created_at": "2023-01-01T09:00:00Z",
              "updated_at": "2024-07-09T14:00:00Z",
              "pushed_at": "2024-07-09T14:00:00Z",
              "archived": false,
              "avatar_url": "",
              "internal": false,
              "template": false,
              "enable_issues": true,
              "external_issues_url": "",
              "enable_wiki": true,
              "external_wiki_url": "",
              "enable_pulls": true,
              "enable_projects": true,
              "enable_releases": true,
              "enable_timetracker": false,
              "has_actions": false,
              "has_packages": false,
              "has_wiki": true,
              "has_issues": true,
              "has_pull_requests": true,
              "ignore_whitespace_conflicts": false,
              "allow_merge_commits": true,
              "allow_rebase": true,
              "allow_rebase_merge": true,
              "allow_squash_merge": true,
              "allow_manual_merges": false,
              "allow_only_contributors_to_create_status": false,
              "allow_external_users_to_create_fork": false,
              "allow_create_branch": true,
              "allow_delete_branch": true,
              "autodetect_manual_merge": false,
              "default_merge_style": "merge",
              "is_template": false,
              "mirror_interval": "",
              "mirror_updated": "0001-01-01T00:00:00Z",
              "parent_html_url": "",
              "parent_full_name": "",
              "repo_transfer": null,
              "status_checks_url": "",
              "issue_template": "",
              "issue_template_branch": "",
              "labels_url": "",
              "releases_url": "",
              "pulls_url": "",
              "branches_url": "",
              "forks_url": "",
              "keys_url": "",
              "collaborators_url": "",
              "hooks_url": "",
              "events_url": "",
              "assignees_url": "",
              "stargazers_url": "",
              "subscribers_url": "",
              "git_pull_url": "",
              "git_push_url": "",
              "html_url_with_branch": "",
              "archived_at": null
            }
          },
          "base": {
            "label": "owner:main",
            "ref": "main",
            "sha": "f1e2d3c4b5a6f7e8d9c0b1a2f3e4d5c6b7a8f9e0",
            "repo_id": 456,
            "repository": {
              "id": 456,
              "owner": {
                "id": 100,
                "login": "owner",
                "full_name": "Repository Owner",
                "email": "owner@example.com",
                "avatar_url": "https://git.example.com/avatars/owner",
                "created_at": "2022-12-01T09:00:00Z",
                "updated_at": "2022-12-01T09:00:00Z",
                "is_admin": true,
                "last_login": "2024-07-09T14:00:00Z",
                "prohibit_login": false,
                "restricted": false,
                "active": true,
                "location": "Earth",
                "website": "https://owner.example.com",
                "description": "The owner of the repository",
                "followers_count": 10,
                "following_count": 0,
                "starred_repos_count": 20,
                "visibility": "public"
              },
              "name": "repo",
              "full_name": "owner/repo",
              "description": "The main project repository",
              "private": false,
              "fork": false,
              "empty": false,
              "parent": null,
              "mirror": false,
              "size": 2048,
              "html_url": "https://git.example.com/owner/repo",
              "ssh_url": "git@git.example.com:owner/repo.git",
              "clone_url": "https://git.example.com/owner/repo.git",
              "website": "",
              "stars_count": 10,
              "forks_count": 5,
              "watchers_count": 7,
              "open_issues_count": 2,
              "open_pr_counter": 1,
              "release_counter": 1,
              "default_branch": "main",
              "created_at": "2022-12-01T08:00:00Z",
              "updated_at": "2024-07-09T14:00:00Z",
              "pushed_at": "2024-07-09T14:00:00Z",
              "archived": false,
              "avatar_url": "",
              "internal": false,
              "template": false,
              "enable_issues": true,
              "external_issues_url": "",
              "enable_wiki": true,
              "external_wiki_url": "",
              "enable_pulls": true,
              "enable_projects": true,
              "enable_releases": true,
              "enable_timetracker": false,
              "has_actions": false,
              "has_packages": false,
              "has_wiki": true,
              "has_issues": true,
              "has_pull_requests": true,
              "ignore_whitespace_conflicts": false,
              "allow_merge_commits": true,
              "allow_rebase": true,
              "allow_rebase_merge": true,
              "allow_squash_merge": true,
              "allow_manual_merges": false,
              "allow_only_contributors_to_create_status": false,
              "allow_external_users_to_create_fork": false,
              "allow_create_branch": true,
              "allow_delete_branch": true,
              "autodetect_manual_merge": false,
              "default_merge_style": "merge",
              "is_template": false,
              "mirror_interval": "",
              "mirror_updated": "0001-01-01T00:00:00Z",
              "parent_html_url": "",
              "parent_full_name": "",
              "repo_transfer": null,
              "status_checks_url": "",
              "issue_template": "",
              "issue_template_branch": "",
              "labels_url": "",
              "releases_url": "",
              "pulls_url": "",
              "branches_url": "",
              "forks_url": "",
              "keys_url": "",
              "collaborators_url": "",
              "hooks_url": "",
              "events_url": "",
              "assignees_url": "",
              "stargazers_url": "",
              "subscribers_url": "",
              "git_pull_url": "",
              "git_push_url": "",
              "html_url_with_branch": "",
              "archived_at": null
            }
          },
          "merge_base": "g9h8j7k6l5m4n3b2v1c0x9z8y7u6i5o4p3q2w1e0",
          "merge_commit_id": "d5c6b7a8f9e0a1b2c3d4e5f6a7b8c9d0e1f2a3b4",
          "mergeable": true,
          "merged": false,
          "status": 1,
          "diff_url": "https://git.example.com/api/v1/repos/owner/repo/pulls/1.diff",
          "patch_url": "https://git.example.com/api/v1/repos/owner/repo/pulls/1.patch",
          "html_url": "https://git.example.com/owner/repo/pulls/1",
          "issue_url": "https://git.example.com/api/v1/repos/owner/repo/issues/1",
          "template": "",
          "allow_merge": true,
          "allow_rebase": true,
          "allow_rebase_merge": true,
          "allow_squash": true,
          "is_work_in_progress": false,
          "is_auto_merge": false,
          "is_tracked": false,
          "is_stale": false,
          "is_draft": false,
          "is_manually_merged": false,
          "is_protected": false,
          "is_blocked": false,
          "is_closed": false,
          "is_merged": false,
          "is_pending": false,
          "is_ready_for_review": true,
          "is_review_requested": false,
          "is_review_required": false,
          "is_review_approved": false,
          "is_review_dismissed": false,
          "is_review_comment_required": false,
          "is_review_comment_dismissed": false,
          "is_review_comment_resolved": false,
          "is_review_comment_unresolved": false,
          "is_review_comment_outdated": false,
          "is_review_comment_pending": false,
          "is_review_comment_stale": false,
          "is_review_comment_draft": false,
          "is_review_comment_resolved_by_user": false,
          "is_review_comment_unresolved_by_user": false,
          "is_review_comment_outdated_by_user": false,
          "is_review_comment_pending_by_user": false,
          "is_review_comment_stale_by_user": false,
          "is_review_comment_draft_by_user": false,
          "is_review_comment_resolved_by_reviewer": false,
          "is_review_comment_unresolved_by_reviewer": false,
          "is_review_comment_outdated_by_reviewer": false,
          "is_review_comment_pending_by_reviewer": false,
          "is_review_comment_stale_by_reviewer": false,
          "is_review_comment_draft_by_reviewer": false,
          "is_review_comment_resolved_by_assignee": false,
          "is_review_comment_unresolved_by_assignee": false,
          "is_review_comment_outdated_by_assignee": false,
          "is_review_comment_pending_by_assignee": false,
          "is_review_comment_stale_by_assignee": false,
          "is_review_comment_draft_by_assignee": false,
          "is_review_comment_resolved_by_milestone": false,
          "is_review_comment_unresolved_by_milestone": false,
          "is_review_comment_outdated_by_milestone": false,
          "is_review_comment_pending_by_milestone": false,
          "is_review_comment_stale_by_milestone": false,
          "is_review_comment_draft_by_milestone": false,
          "is_review_comment_resolved_by_label": false,
          "is_review_comment_unresolved_by_label": false,
          "is_review_comment_outdated_by_label": false,
          "is_review_comment_pending_by_label": false,
          "is_review_comment_stale_by_label": false,
          "is_review_comment_draft_by_label": false,
          "is_review_comment_resolved_by_assignee_and_label": false,
          "is_review_comment_unresolved_by_assignee_and_label": false,
          "is_review_comment_outdated_by_assignee_and_label": false,
          "is_review_comment_pending_by_assignee_and_label": false,
          "is_review_comment_stale_by_assignee_and_label": false,
          "is_review_comment_draft_by_assignee_and_label": false,
          "is_review_comment_resolved_by_milestone_and_label": false,
          "is_review_comment_unresolved_by_milestone_and_label": false,
          "is_review_comment_outdated_by_milestone_and_label": false,
          "is_review_comment_pending_by_milestone_and_label": false,
          "is_review_comment_stale_by_milestone_and_label": false,
          "is_review_comment_draft_by_milestone_and_label": false,
          "is_review_comment_resolved_by_assignee_and_milestone": false,
          "is_review_comment_unresolved_by_assignee_and_milestone": false,
          "is_review_comment_outdated_by_assignee_and_milestone": false,
          "is_review_comment_pending_by_assignee_and_milestone": false,
          "is_review_comment_stale_by_assignee_and_milestone": false,
          "is_review_comment_draft_by_assignee_and_milestone": false,
          "is_review_comment_resolved_by_assignee_and_milestone_and_label": false,
          "is_review_comment_unresolved_by_assignee_and_milestone_and_label": false,
          "is_review_comment_outdated_by_assignee_and_milestone_and_label": false,
          "is_review_comment_pending_by_assignee_and_milestone_and_label": false,
          "is_review_comment_stale_by_assignee_and_milestone_and_label": false,
          "is_review_comment_draft_by_assignee_and_milestone_and_label": false,
          "is_review_comment_resolved_by_reviewer_and_assignee": false,
          "is_review_comment_unresolved_by_reviewer_and_assignee": false,
          "is_review_comment_outdated_by_reviewer_and_assignee": false,
          "is_review_comment_pending_by_reviewer_and_assignee": false,
          "is_review_comment_stale_by_reviewer_and_assignee": false,
          "is_review_comment_draft_by_reviewer_and_assignee": false,
          "is_review_comment_resolved_by_reviewer_and_milestone": false,
          "is_review_comment_unresolved_by_reviewer_and_milestone": false,
          "is_review_comment_outdated_by_reviewer_and_milestone": false,
          "is_review_comment_pending_by_reviewer_and_milestone": false,
          "is_review_comment_stale_by_reviewer_and_milestone": false,
          "is_review_comment_draft_by_reviewer_and_milestone": false,
          "is_review_comment_resolved_by_reviewer_and_label": false,
          "is_review_comment_unresolved_by_reviewer_and_label": false,
          "is_review_comment_outdated_by_reviewer_and_label": false,
          "is_review_comment_pending_by_reviewer_and_label": false,
          "is_review_comment_stale_by_reviewer_and_label": false,
          "is_review_comment_draft_by_reviewer_and_label": false,
          "is_review_comment_resolved_by_reviewer_and_assignee_and_milestone": false,
          "is_review_comment_unresolved_by_reviewer_and_assignee_and_milestone": false,
          "is_review_comment_outdated_by_reviewer_and_assignee_and_milestone": false,
          "is_review_comment_pending_by_reviewer_and_assignee_and_milestone": false,
          "is_review_comment_stale_by_reviewer_and_assignee_and_milestone": false,
          "is_review_comment_draft_by_reviewer_and_assignee_and_milestone": false,
          "is_review_comment_resolved_by_reviewer_and_assignee_and_label": false,
          "is_review_comment_unresolved_by_reviewer_and_assignee_and_label": false,
          "is_review_comment_outdated_by_reviewer_and_assignee_and_label": false,
          "is_review_comment_pending_by_reviewer_and_assignee_and_label": false,
          "is_review_comment_stale_by_assignee_and_label": false,
          "is_review_comment_draft_by_assignee_and_label": false,
          "is_review_comment_resolved_by_reviewer_and_milestone_and_label": false,
          "is_review_comment_unresolved_by_reviewer_and_milestone_and_label": false,
          "is_review_comment_outdated_by_milestone_and_label": false,
          "is_review_comment_pending_by_milestone_and_label": false,
          "is_review_comment_stale_by_milestone_and_label": false,
          "is_review_comment_draft_by_milestone_and_label": false,
          "is_review_comment_resolved_by_reviewer_and_assignee_and_milestone_and_label": false,
          "is_review_comment_unresolved_by_reviewer_and_assignee_and_milestone_and_label": false,
          "is_review_comment_outdated_by_reviewer_and_assignee_and_milestone_and_label": false,
          "is_review_comment_pending_by_reviewer_and_assignee_and_milestone_and_label": false,
          "is_review_comment_stale_by_reviewer_and_assignee_and_milestone_and_label": false,
          "is_review_comment_draft_by_reviewer_and_assignee_and_milestone_and_label": false
        }
      ]
      
  • Get a Specific Pull Request:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/pulls/{index}

    • Description: Gets detailed information for a single pull request.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      {
        "id": 123,
        "index": 1,
        "url": "https://forgejo.example.com/api/v1/repos/octocat/hello-world/pulls/1",
        "html_url": "https://forgejo.example.com/octocat/hello-world/pulls/1",
        "diff_url": "https://forgejo.example.com/octocat/hello-world/pulls/1.diff",
        "patch_url": "https://forgejo.example.com/octocat/hello-world/pulls/1.patch",
        "issue_url": "https://forgejo.example.com/api/v1/repos/octocat/hello-world/issues/1",
        "title": "Update README.md",
        "body": "This pull request updates the README with more information.",
        "labels": [
          {
            "id": 1,
            "name": "bug",
            "color": "f29513",
            "description": "Something isn't working"
          }
        ],
        "milestone": null,
        "assignee": {
          "id": 1,
          "login": "octocat",
          "full_name": "Octo Cat",
          "email": "octocat@example.com",
          "avatar_url": "https://forgejo.example.com/avatars/1",
          "url": "https://forgejo.example.com/api/v1/users/octocat"
        },
        "assignees": [],
        "state": "open",
        "is_locked": false,
        "comments": 0,
        "created_at": "2023-01-01T10:00:00Z",
        "updated_at": "2023-01-01T10:00:00Z",
        "closed_at": null,
        "merged_at": null,
        "merge_commit_sha": null,
        "merged_by": null,
        "base": {
          "label": "main",
          "ref": "main",
          "sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
          "repo": {
            "id": 1,
            "name": "hello-world",
            "full_name": "octocat/hello-world",
            "owner": {
              "id": 1,
              "login": "octocat",
              "full_name": "Octo Cat",
              "email": "octocat@example.com",
              "avatar_url": "https://forgejo.example.com/avatars/1",
              "url": "https://forgejo.example.com/api/v1/users/octocat"
            },
            "html_url": "https://forgejo.example.com/octocat/hello-world",
            "url": "https://forgejo.example.com/api/v1/repos/octocat/hello-world",
            "description": "A sample repository",
            "private": false,
            "fork": false,
            "empty": false,
            "size": 10,
            "forks_count": 0,
            "stars_count": 0,
            "watchers_count": 0,
            "open_issues_count": 1,
            "open_pr_counter": 1,
            "default_branch": "main",
            "created_at": "2022-12-01T09:00:00Z",
            "updated_at": "2023-01-01T10:00:00Z"
          }
        },
        "head": {
          "label": "feature-branch",
          "ref": "feature-branch",
          "sha": "f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f2e1",
          "repo": {
            "id": 1,
            "name": "hello-world",
            "full_name": "octocat/hello-world",
            "owner": {
              "id": 1,
              "login": "octocat",
              "full_name": "Octo Cat",
              "email": "octocat@example.com",
              "avatar_url": "https://forgejo.example.com/avatars/1",
              "url": "https://forgejo.example.com/api/v1/users/octocat"
            },
            "html_url": "https://forgejo.example.com/octocat/hello-world",
            "url": "https://forgejo.example.com/api/v1/repos/octocat/hello-world",
            "description": "A sample repository",
            "private": false,
            "fork": false,
            "empty": false,
            "size": 10,
            "forks_count": 0,
            "stars_count": 0,
            "watchers_count": 0,
            "open_issues_count": 1,
            "open_pr_counter": 1,
            "default_branch": "main",
            "created_at": "2022-12-01T09:00:00Z",
            "updated_at": "2023-01-01T10:00:00Z"
          }
        },
        "mergeable": true,
        "merged": false,
        "state_reason": null
      }
      
  • List Pull Request Comments:

    • Endpoint: GET /api/v1/repos/{owner}/{repo}/pulls/{index}/reviews

    • Description: Fetches review comments for a specific pull request.

    • Authentication: Requires a Forgejo API token, passed in the Authorization header as token YOUR_TOKEN.

    • Example Response:

      [
        {
          "body": "This is a sample comment on a pull request review.",
          "commit_id": "a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4",
          "created_at": "2023-10-27T10:00:00Z",
          "diff_hunk": "@@ -10,6 +10,7 @@\n  line 10\n +new line\n  line 11",
          "html_url": "https://forgejo.example.com/owner/repo/pulls/1/files#diff-1234567890abcdef1234567890abcdef1234567890_R10",
          "id": 12345,
          "original_commit_id": "f6e5d4c3b2a10987f6e5d4c3b2a10987f6e5d4c3",
          "original_position": 10,
          "path": "src/main.go",
          "position": 11,
          "pull_request_review_id": 54321,
          "pull_request_url": "https://forgejo.example.com/api/v1/repos/owner/repo/pulls/1",
          "resolver": {
            "active": true,
            "avatar_url": "https://forgejo.example.com/avatars/user.png",
            "created": "2023-01-01T08:00:00Z",
            "description": "A sample user",
            "email": "user@example.com",
            "followers_count": 5,
            "following_count": 2,
            "full_name": "Sample User",
            "id": 1,
            "is_admin": false,
            "language": "en-US",
            "last_login": "2023-10-27T09:50:00Z",
            "location": "Earth",
            "login": "sampleuser",
            "prohibit_login": false,
            "restricted": false,
            "starred_repos_count": 10,
            "visibility": "public",
            "website": "https://example.com"
          },
          "updated_at": "2023-10-27T10:00:00Z",
          "user": {
            "active": true,
            "avatar_url": "https://forgejo.example.com/avatars/user.png",
            "created": "2023-01-01T08:00:00Z",
            "description": "A sample user",
            "email": "user@example.com",
            "followers_count": 5,
            "following_count": 2,
            "full_name": "Sample User",
            "id": 1,
            "is_admin": false,
            "language": "en-US",
            "last_login": "2023-10-27T09:50:00Z",
            "location": "Earth",
            "login": "sampleuser",
            "prohibit_login": false,
            "restricted": false,
            "starred_repos_count": 10,
            "visibility": "public",
            "website": "https://example.com"
          }
        }
      ]