apiVersion: v1
data:
  github.yaml: |-
    openapi: 3.0.0
    info:
      title: GitHub Repository Automation API
      version: 1.0.0
      description: API specification for automating GitHub repository tasks using the GitHub REST API v3.

    servers:
      - url: https://api.github.com
        description: GitHub API
    security:
    - BearerToken: []
    paths:
      /repos/{owner}/{repo}/git/refs/{ref}:
        patch:
          summary: Update a branch reference
          operationId: updateBranchRef
          parameters:
            - name: owner
              in: path
              required: true
              schema:
                type: string
            - name: repo
              in: path
              required: true
              schema:
                type: string
            - name: ref
              in: path
              required: true
              schema:
                type: string
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    sha:
                      type: string
                    force:
                      type: boolean
          responses:
            '200':
              description: Branch updated successfully
              content:
                application/json:
                  schema:
                    type: object
        get:
          summary: Get the SHA of a ref
          operationId: getBranchSHA
          parameters:
            - name: owner
              in: path
              required: true
              schema:
                type: string
            - name: repo
              in: path
              required: true
              schema:
                type: string
            - name: ref
              in: path
              required: true
              schema:
                type: string
          responses:
            '200':
              description: Successfully retrieved branch reference
              content:
                application/json:
                  schema:
                    type: object
                    properties:
                      object:
                        type: object
                        properties:
                          sha:
                            type: string
            '404':
              description: Branch not found
      /repos/{owner}/{repo}/git/refs:
        post:
          summary: Create a new branch
          operationId: createBranch
          parameters:
            - name: owner
              in: path
              required: true
              schema:
                type: string
            - name: repo
              in: path
              required: true
              schema:
                type: string
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    ref:
                      type: string
                    sha:
                      type: string
          responses:
            '201':
              description: Branch created successfully
              content:
                application/json:
                  schema:
                    type: object
      /repos/{owner}/{repo}/git/blobs:
        post:
          summary: Create a new blob
          operationId: createBlob
          parameters:
            - name: owner
              in: path
              required: true
              schema:
                type: string
            - name: repo
              in: path
              required: true
              schema:
                type: string
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    content:
                      type: string
                    encoding:
                      type: string
          responses:
            '201':
              description: Blob created successfully
              content:
                application/json:
                  schema:
                    type: object
      /repos/{owner}/{repo}/git/trees:
        post:
          summary: Create a new tree
          operationId: createTree
          parameters:
            - name: owner
              in: path
              required: true
              schema:
                type: string
            - name: repo
              in: path
              required: true
              schema:
                type: string
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    base_tree:
                      type: string
                    tree:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                          mode:
                            type: string
                          type:
                            type: string
                          sha:
                            type: string
          responses:
            '201':
              description: Tree created successfully
              content:
                application/json:
                  schema:
                    type: object
      /repos/{owner}/{repo}/git/commits:
        post:
          summary: Create a new commit
          operationId: createCommit
          parameters:
            - name: owner
              in: path
              required: true
              schema:
                type: string
            - name: repo
              in: path
              required: true
              schema:
                type: string
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    message:
                      type: string
                    tree:
                      type: string
                    parents:
                      type: array
                      items:
                        type: string
          responses:
            '201':
              description: Commit created successfully
              content:
                application/json:
                  schema:
                    type: object
      /repos/{owner}/{repo}/git/commits/{commit_sha}:
        get:
          summary: Get details of a commit
          operationId: getCommitDetails
          parameters:
            - name: owner
              in: path
              required: true
              schema:
                type: string
            - name: repo
              in: path
              required: true
              schema:
                type: string
            - name: commit_sha
              in: path
              required: true
              schema:
                type: string
          responses:
            '200':
              description: Commit details retrieved successfully
              content:
                application/json:
                  schema:
                    type: object
      /repos/{owner}/{repo}/pulls:
        post:
          summary: Create a pull request
          description: Opens a new pull request from a branch to the base branch.
          operationId: createPullRequest
          parameters:
            - name: owner
              in: path
              required: true
              schema:
                type: string
            - name: repo
              in: path
              required: true
              schema:
                type: string
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    title:
                      type: string
                      example: "New Feature: Added new file"
                    body:
                      type: string
                      example: "This PR adds a new file using the GitHub REST API."
                    head:
                      type: string
                      example: "new-feature-branch"
                    base:
                      type: string
                      example: "main"
          responses:
            '201':
              description: Pull request created successfully.
              content:
                application/json:
                  schema:
                    type: object
                    properties:
                      html_url:
                        type: string
                        example: "https://github.com/user/repo/pull/42"
            '422':
              description: Invalid input or pull request already exists.
    components:
      securitySchemes:
        BearerToken:
          type: http
          scheme: bearer
          description: Bearer Token authentication
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: 02-custom-auth-create-branch-resources-specs
