Mandresy RABENJAHARISON d075c60e1e feat: Update patch-issue workflow to use auth token for FastAPI
Upgraded the patch-odoo-ticket action to version v1.3 and added support for an authentication token to secure communication with the FastAPI server. Modified the workflow, main logic, and action definition to handle the auth_token input and ensure proper authorization. Includes error handling for missing or invalid tokens.
2025-09-04 13:45:32 +03:00
2025-08-11 15:58:36 +03:00
2025-08-11 15:58:36 +03:00
2025-08-21 16:34:26 +03:00

Patch Odoo Ticket Gitea Action

Update an Odoo ticket via a FastAPI middleware whenever a Gitea Issue is created/updated/closed.

This action reads details from the issue event context and POSTs a JSON payload to your FastAPI endpoint at /api/v1/patch_gitea_odoo. The FastAPI service is responsible for talking to Odoo via JSON-RPC.


What it sends

The action builds a JSON array with a single object from the issue event:

[
  {
    "task_id": 123,
    "state": "open",
    "assignees": ["alice", "bob"],
    "date_deadline": "2025-05-06"
  }
]
  • task_id: from ${{ gitea.event.issue.number }}
  • state: from ${{ gitea.event.issue.state }} ("open" or "closed")
  • author: from ${{ gitea.event.issue.user.login }}
  • assignees: from ${{ join(gitea.event.issue.assignees.*.login, ',') }} (expanded and split)
  • labels: from ${{ join(gitea.event.issue.labels.*.name, ',') }} (expanded and split)
  • date_deadline: from ${{ gitea.event.issue.due_date }} if present

Inputs

  • base_url (required): Base URL of your FastAPI server, e.g. https://fastapi.example.com.

Usage

Trigger on the events you care about (edit, labeled, closed, etc.). Example:

name: Sync Odoo ticket

on:
  issues:
    types: [edited, closed, reopened, assigned, unassigned, labeled, unlabeled]

jobs:
  patch-odoo:
    runs-on: ubuntu-latest
    steps:
      - name: Send update to Odoo via FastAPI
        uses: https://gitea.ethumada.com/gitea/patch-odoo-ticket
        with:
          base_url: ${{ vars.FASTAPI_BASE_URL }}

Secrets/variables:

  • Set FASTAPI_BASE_URL secret to your FastAPI base URL.

FastAPI endpoint contract

  • Method: POST
  • URL: {base_url}/api/v1/patch_gitea_odoo
  • Body: JSON array of one or more objects as above
  • Return: 2xx on success, any body will be logged for debugging
Description
Update an Odoo ticket via FastAPI when a Gitea Issue changes
Readme 37 KiB
2025-09-04 10:45:32 +00:00
Languages
Go 79.7%
Dockerfile 20.3%