arazzo: 1.0.1 info: title: Gitea Provision Organization Repository With Webhook summary: Create an organization, add a repository to it, and register a webhook. description: >- Stands up a new organization workspace on Gitea. The workflow creates an organization, creates a repository owned by that organization, and registers a webhook on the repository so external systems receive push and pull request events. Each step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: giteaApi url: ../openapi/gitea-rest-api-openapi.yml type: openapi workflows: - workflowId: org-repo-with-webhook summary: Create an org, create a repo in it, and register a webhook. description: >- Creates an organization, creates a repository under it, then registers a gitea-type webhook on the repository. inputs: type: object required: - authToken - orgUsername - repoName - webhookUrl properties: authToken: type: string description: Authorization header value, e.g. "token ". orgUsername: type: string description: Username (slug) of the organization to create. orgFullName: type: string description: Display name of the organization. repoName: type: string description: Name of the repository to create under the organization. repoDescription: type: string description: Description of the repository. webhookUrl: type: string description: Target URL the webhook delivers payloads to. steps: - stepId: createOrg description: Create a new organization. operationId: orgCreate parameters: - name: Authorization in: header value: $inputs.authToken requestBody: contentType: application/json payload: username: $inputs.orgUsername full_name: $inputs.orgFullName visibility: public successCriteria: - condition: $statusCode == 201 outputs: orgId: $response.body#/id orgName: $response.body#/username - stepId: createOrgRepo description: Create a repository owned by the new organization. operationId: createOrgRepo parameters: - name: Authorization in: header value: $inputs.authToken - name: org in: path value: $inputs.orgUsername requestBody: contentType: application/json payload: name: $inputs.repoName description: $inputs.repoDescription auto_init: true private: false successCriteria: - condition: $statusCode == 201 outputs: repoId: $response.body#/id repoFullName: $response.body#/full_name - stepId: createWebhook description: Register a gitea-type webhook on the new repository. operationId: repoCreateHook parameters: - name: Authorization in: header value: $inputs.authToken - name: owner in: path value: $inputs.orgUsername - name: repo in: path value: $inputs.repoName requestBody: contentType: application/json payload: type: gitea active: true events: - push - pull_request config: url: $inputs.webhookUrl content_type: json successCriteria: - condition: $statusCode == 201 outputs: hookId: $response.body#/id outputs: orgId: $steps.createOrg.outputs.orgId repoId: $steps.createOrgRepo.outputs.repoId hookId: $steps.createWebhook.outputs.hookId