Gitea · Arazzo Workflow

Gitea Create Repository With Webhook

Version 1.0.0

Create a repository for the authenticated user and register a webhook.

1 workflow 1 source API 1 provider
View Spec View on GitHub GitSource ControlDevOpsCI/CDCode HostingOpen SourceSelf HostedPackage RegistryIssue TrackingPull RequestsArazzoWorkflows

Provider

gitea

Workflows

repo-with-webhook
Create a repo and register a webhook on it.
Creates a repository for the authenticated user, then registers a gitea-type webhook on it for push and pull request events.
2 steps inputs: authToken, owner, repoDescription, repoName, webhookSecret, webhookUrl outputs: hookId, repoFullName, repoId
1
createRepo
createCurrentUserRepo
Create a repository for the authenticated user.
2
createWebhook
repoCreateHook
Register a gitea-type webhook on the new repository.

Source API Descriptions

Arazzo Workflow Specification

gitea-repo-with-webhook-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Gitea Create Repository With Webhook
  summary: Create a repository for the authenticated user and register a webhook.
  description: >-
    Bootstraps a repository wired for automation on Gitea. The workflow creates
    a repository for the authenticated user and immediately registers a
    gitea-type webhook so downstream systems receive events from the first
    commit onward. 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: repo-with-webhook
  summary: Create a repo and register a webhook on it.
  description: >-
    Creates a repository for the authenticated user, then registers a
    gitea-type webhook on it for push and pull request events.
  inputs:
    type: object
    required:
    - authToken
    - owner
    - repoName
    - webhookUrl
    properties:
      authToken:
        type: string
        description: Authorization header value, e.g. "token <personal-access-token>".
      owner:
        type: string
        description: Username that owns the new repository (the authenticated user).
      repoName:
        type: string
        description: Name of the repository to create.
      repoDescription:
        type: string
        description: Description of the repository.
      webhookUrl:
        type: string
        description: Target URL the webhook delivers payloads to.
      webhookSecret:
        type: string
        description: Optional shared secret used to sign webhook payloads.
  steps:
  - stepId: createRepo
    description: Create a repository for the authenticated user.
    operationId: createCurrentUserRepo
    parameters:
    - name: Authorization
      in: header
      value: $inputs.authToken
    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.owner
    - 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
          secret: $inputs.webhookSecret
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      hookId: $response.body#/id
      hookType: $response.body#/type
  outputs:
    repoId: $steps.createRepo.outputs.repoId
    repoFullName: $steps.createRepo.outputs.repoFullName
    hookId: $steps.createWebhook.outputs.hookId