GitHub Analysis API

The Analysis API from GitHub — 3 operation(s) for analysis.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/ https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

OpenAPI Specification

github-analysis-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.1.4
  title: GitHub Application About Analysis API
  description: 'Use the REST API to retrieve information about GitHub Apps and GitHub App

    installations.'
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: ghes
  x-github-release: 3.9
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
tags:
- name: Analysis
paths:
  /repos/{owner}/{repo}/code-scanning/analyses:
    get:
      summary: GitHub List Code Scanning Analyses for Repository
      description: 'Lists the details of all code scanning analyses for a repository,

        starting with the most recent.

        The response is paginated and you can use the `page` and `per_page` parameters

        to list the analyses you''re interested in.

        By default 30 analyses are listed per page.


        The `rules_count` field in the response give the number of rules

        that were run in the analysis.

        For very old analyses this data is not available,

        and `0` is returned in this field.


        **Deprecation notice**:

        The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.


        OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      operationId: listCodeScanningAnalysesForRepository
      tags:
      - Analysis
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/tool-name'
      - $ref: '#/components/parameters/tool-guid'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      - name: ref
        in: query
        description: The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/<branch name>` or simply `<branch name>`. To reference a pull request use `refs/pull/<number>/merge`.
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-ref'
        example: main
      - name: sarif_id
        in: query
        description: Filter analyses belonging to the same SARIF upload.
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-analysis-sarif-id'
        example: '12345678'
      - $ref: '#/components/parameters/direction'
      - name: sort
        description: The property by which to sort the results.
        in: query
        required: false
        schema:
          type: string
          enum:
          - created
          default: created
        example: created
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/code-scanning-analysis'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-analysis-items'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: false
        category: code-scanning
        subcategory: code-scanning
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}:
    get:
      summary: GitHub Get Code Scanning Analysis for Repository
      description: 'Gets a specified code scanning analysis for a repository.


        The default JSON response contains fields that describe the analysis.

        This includes the Git reference and commit SHA to which the analysis relates,

        the datetime of the analysis, the name of the code scanning tool,

        and the number of alerts.


        The `rules_count` field in the default response give the number of rules

        that were run in the analysis.

        For very old analyses this data is not available,

        and `0` is returned in this field.


        This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."


        - **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.


        OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      operationId: getCodeScanningAnalysisForRepository
      tags:
      - Analysis
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - name: analysis_id
        in: path
        description: The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.
        required: true
        schema:
          type: integer
        example: 42
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-analysis'
              examples:
                response:
                  $ref: '#/components/examples/code-scanning-analysis-default'
            application/json+sarif:
              schema:
                type: object
                additionalProperties: true
              examples:
                response:
                  $ref: '#/components/examples/code-scanning-analysis-sarif'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: false
        category: code-scanning
        subcategory: code-scanning
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete Code Scanning Analysis from Repository
      description: "Deletes a specified code scanning analysis from a repository.\n\nYou can delete one analysis at a time.\nTo delete a series of analyses, start with the most recent analysis and work backwards.\nConceptually, the process is similar to the undo function in a text editor.\n\nWhen you list the analyses for a repository,\none or more will be identified as deletable in the response:\n\n```\n\"deletable\": true\n```\n\nAn analysis is deletable when it's the most recent in a set of analyses.\nTypically, a repository will have multiple sets of analyses\nfor each enabled code scanning tool,\nwhere a set is determined by a unique combination of analysis values:\n\n* `ref`\n* `tool`\n* `category`\n\nIf you attempt to delete an analysis that is not the most recent in a set,\nyou'll Get 400 response with the message:\n\n```\nAnalysis specified is not deletable.\n```\n\nThe response from a successful `DELETE` operation provides you with\ntwo alternative URLs for deleting the next analysis in the set:\n`next_analysis_url` and `confirm_delete_url`.\nUse the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis\nin a set. This is a useful option if you want to preserve at least one analysis\nfor the specified tool in your repository.\nUse the `confirm_delete_url` URL if you are content to remove all analyses for a tool.\nWhen you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`\nin the 200 response is `null`.\n\nAs an example of the deletion process,\nlet's imagine that you added a workflow that configured a particular code scanning tool\nto analyze the code in a repository. This tool has added 15 analyses:\n10 on the default branch, and another 5 on a topic branch.\nYou therefore have two separate sets of analyses for this tool.\nYou've now decided that you want to remove all of the analyses for the tool.\nTo do this you must make 15 separate deletion requests.\nTo start, you must find an analysis that's identified as deletable.\nEach set of analyses always has one that's identified as deletable.\nHaving found the deletable analysis for one of the two sets,\ndelete this analysis and then continue deleting the next analysis in the set until they're all deleted.\nThen repeat the process for the second set.\nThe procedure therefore consists of a nested loop:\n\n**Outer loop**:\n* List the analyses for the repository, filtered by tool.\n* Parse this list to find a deletable analysis. If found:\n\n\n\n\n\n\n\n\n\n\n\n  **Inner loop**:\n  * Delete the identified analysis.\n  * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.\n\nThe above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.\n\nOAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories."
      operationId: deleteCodeScanningAnalysisFromRepository
      tags:
      - Analysis
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - name: analysis_id
        in: path
        description: The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.
        required: true
        schema:
          type: integer
        example: 42
      - name: confirm_delete
        in: query
        description: 'Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to `true`, you''ll Get 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.`'
        required: false
        schema:
          type: string
        example: example_value
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-analysis-deletion'
              examples:
                default-response:
                  $ref: '#/components/examples/code-scanning-analysis-deletion'
        '400':
          $ref: '#/components/responses/bad_request'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_write'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: false
        category: code-scanning
        subcategory: code-scanning
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/code-scanning/sarifs:
    post:
      summary: GitHub Upload an Analysis as Sarif Data
      description: "Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see \"[Troubleshooting SARIF uploads](https://docs.github.com/enterprise-server@3.9/code-security/code-scanning/troubleshooting-sarif).\"\n\nThere are two places where you can upload code scanning results.\n - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see \"[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests).\"\n - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see \"[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository).\"\n\nYou must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:\n\n```\ngzip -c analysis-data.sarif | base64 -w0\n```\n\nSARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.\nTo get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see \"[SARIF results exceed one or more limits](https://docs.github.com/enterprise-server@3.9/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit).\"\n\n\n| **SARIF data**                   | **Maximum values** | **Additional limits**                                                            |\n|-|::|-|\n| Runs per file                    |         20         |                                                                                  |\n| Results per run                  |       25,000       | Only the top 5,000 results will be included, prioritized by severity.            |\n| Rules per run                    |       25,000       |                                                                                  |\n| Tool extensions per run          |        100         |                                                                                  |\n| Thread Flow Locations per result |       10,000       | Only the top 1,000 Thread Flow Locations will be included, using prioritization. |\n| Location per result\t             |       1,000        | Only 100 locations will be included.                                             |\n| Tags per rule\t                   |         20         | Only 10 tags will be included.                                                   |\n\n\nThe `202 Accepted` response includes an `id` value.\nYou can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint.\nFor more information, see \"[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload).\"\n\nOAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories."
      operationId: uploadAnAnalysisAsSarifData
      tags:
      - Analysis
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                commit_sha:
                  $ref: '#/components/schemas/code-scanning-analysis-commit-sha'
                ref:
                  $ref: '#/components/schemas/code-scanning-ref-full'
                sarif:
                  $ref: '#/components/schemas/code-scanning-analysis-sarif-file'
                checkout_uri:
                  description: 'The base directory used in the analysis, as it appears in the SARIF file.

                    This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository.'
                  example: file:///github/workspace/
                  type: string
                  format: uri
                started_at:
                  description: 'The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.'
                  format: date-time
                  type: string
                tool_name:
                  description: The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`.
                  type: string
              additionalProperties: false
              required:
              - commit_sha
              - ref
              - sarif
            examples:
              default:
                value:
                  commit_sha: 4b6472266afd7b471e86085a6659e8c7f2b119da
                  ref: refs/heads/master
                  sarif: H4sICMLGdF4AA2V4YW1wbGUuc2FyaWYAvVjdbts2FL7PUxDCijaA/CM7iRNfLkPXYgHSNstumlzQ0pHFVCI1korjFgH2ONtr7Ul2KFmy/mOn6QIkjsjDw0/nfN85NL8dEGL9pNwAImqRObECrWM1H40kXQ2XTAfJIlEgXcE1cD10RTQSVDE10K4aKSqZP1AxuKOIKg1ydJU60jSfSh8Hk6EzHA/vlOCWbfa7B6kYPpj90rlsWCZcmbHP5Bs+4oAWIjQD2SMOeJLh2vIQDnIaQerqXHjw8YIgxohybxAyDsS4cAPKsp03K4RcUs6+Up2D+JXpd8mibKIQN9fM/aMCdbyBujGSSQgVxJtx5qX2d2qUcIweQhEuDQf3GBO6CKHkogx/N3MVCKl/AeVKFuf4y5ubsMGDTj1ep+5I7sgmLIpxtU38hLtmMRGSuCFVyip5eKzs5ydh+LztVL6f2m6oih1BkYiuyQIIJWodxVpERPj4sEiWBNNH8EWT0DMG8EAjzKVHXCrB4FkPu/F64NMk1OeC+2yZSNoBOoR7CC0EzYWGbm+xFDFIzbI011+cLjfZtyJkmMZfumAh02uL3NpV2y+MZ6RAjxibyKrNxxJcVjANSb4eBGwZ1M0KsuyR2poLr5rMl8vaDSeVn6eTWEO2j2xIEcmhwlTKNOi4GMOI8gfuZYkvJ7b4v5Tiumyz7RnHeodFzpS8ASIZCH/AYdWi2z3sG8JtFxJ6fF9yR9CdifBr9Pd6d5V2+zbJKjjCFGGmsHuYFy2ytJq9tUxcLSRSQecppOGKrpUxYfxefMEFK+wOGa4hudQByBVT0L+EKtyACxnRsABhEx1QjVDs1KNI9MbpnhqfE45B6FJvu3hRu5VRU9MhZLmK7fqkKyQSTHNoyMqUFMqXCV3CwAeqEwmVokraK8IuBaGvHjQ0gMYrKjnjyw7uk9uD8tgmsBbFMPnU1bV2ZhkJNkuolUiWys3UPWzs5aaIUz9TBe8zMb+6+nT+6fLy91dlE3xzeDDT4zYszb0bW6NjJd0Rvn2EnLvWLFSdKPpBzInzfRgu8ETyMcH8nIfMnJCeC2PyfTA+UKngcnGH7Hw2hGkVQs5YlIRCtdWZYQ4/73es2JlxkfViOEIhoWJq5Oo6UBBfiKIqFBWhiE3jJGbFwVoxBHTRSuIS67sMeplei24X20shLjG+8gqbKC/bESiNMC+wd5q5id0yeS7CJEqXzmrTWNq3k05l84P6f4/bEmXFJjI0fIt1BGQssUnUDkBYeVhE5TqPnMH3jqogDcP0zKcTgLPTMSzOjhbjuVOmW23l1fYNStulfo6sXlFsGLhbDy5RECPRYGCTgOj2bd4nUQEivEd0H7KKYxqnEhFohuur3a3UPskbH/+Yg0+M5P2MHRJu3ziHh3Z2NCrWt3XF1rWTw8Ne/pfbWYXnDSE0SNZQQt1i18q7te2vOhu7ehWuvVyeu0wbLZi24mhoo6aOOTltzG/lgdVvVoXQq5V+pewkFIzL8fjEcadT55jOjpzFzHuOTtDNrMkJPMVQDd7F09RID72O/UPZ0tmctqZ7kWX6EmSZnDpP8GU67SXM8XE3YSrxbKsx6UReZ4y6n/FVZfJjs9Z7stma75W5yQtkzjk5eSJxk1lv4o7+j8TlhaJ2lsKWZO6lruDPBLib3x5ZN/KGWzZ+pn///evv7OOf4iIBv3oY9L/l1wiJ9p0Tc+F1zZnOE9NxXWEus6IQhr5pMfoqxi8WPsuu0azsns4UC6WzNzHIzbeEx4P/AJ3SefgcFAAA
      responses:
        '202':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-sarifs-receipt'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-sarif-upload'
        '400':
          description: Bad Request if the sarif field is invalid
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_write'
        '404':
          $ref: '#/components/responses/not_found'
        '413':
          description: Payload Too Large if the sarif field is too large
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: false
        category: code-scanning
        subcategory: code-scanning
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  responses:
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    service_unavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              documentation_url:
                type: string
    bad_request:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
        application/scim+json:
          schema:
            $ref: '#/components/schemas/scim-error'
    code_scanning_forbidden_write:
      description: Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    code_scanning_forbidden_read:
      description: Response if GitHub Advanced Security is not enabled for this repository
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
  schemas:
    code-scanning-analysis-tool-version:
      type: string
      description: The version of the tool used to generate the code scanning analysis.
    code-scanning-analysis-analysis-key:
      type: string
      description: Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.
    code-scanning-analysis-sarif-id:
      type: string
      description: An identifier for the upload.
      example: 6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53
    basic-error:
      title: Basic Error
      description: Basic Error
      type: object
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        status:
          type: string
          example: open
    code-scanning-analysis:
      type: object
      properties:
        ref:
          $ref: '#/components/schemas/code-scanning-ref'
        commit_sha:
          $ref: '#/components/schemas/code-scanning-analysis-commit-sha'
        analysis_key:
          $ref: '#/components/schemas/code-scanning-analysis-analysis-key'
        environment:
          $ref: '#/components/schemas/code-scanning-analysis-environment'
        category:
          $ref: '#/components/schemas/code-scanning-analysis-category'
        error:
          type: string
          example: error reading field xyz
        created_at:
          $ref: '#/components/schemas/code-scanning-analysis-created-at'
        results_count:
          type: integer
          description: The total number of results in the analysis.
          example: 42
        rules_count:
          type: integer
          description: The total number of rules used in the analysis.
          example: 42
        id:
          type: integer
          description: Unique identifier for this analysis.
          example: 42
        url:
          $ref: '#/components/schemas/code-scanning-analysis-url'
        sarif_id:
          $ref: '#/components/schemas/code-scanning-analysis-sarif-id'
        tool:
          $ref: '#/components/schemas/code-scanning-analysis-tool'
        deletable:
          type: boolean
          example: true
        warning:
          type: string
          description: Warning generated when processing the analysis
          example: 123 results were ignored
      required:
      - ref
      - commit_sha
      - analysis_key
      - environment
      - error
      - created_at
      - results_count
      - rules_count
      - id
      - url
      - sarif_id
      - tool
      - deletable
      - warning
    code-scanning-sarifs-receipt:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/code-scanning-analysis-sarif-id'
        url:
          type: string
          description: The REST API URL for checking the status of the upload.
          format: uri
          readOnly: true
          example: https://api.github.com/repos/octocat/Hello-World
    code-scanning-analysis-sarif-file:
      description: Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/enterprise-server@3.9/code-security/secure-coding/sarif-support-for-code-scanning)."
      type: string
    code-scanning-analysis-tool-name:
      type: string
      description: The name of the tool used to generate the code scanning analysis.
    scim-error:
      title: Scim Error
      description: Scim Error
      type: object
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        detail:
          type: string
          example: example_value
        status:
          type: integer
          example: 42
        scimType:
          type: string
          example: User
        schemas:
          type: array
          items:
            type: string
    code-scanning-analysis-deletion:
      title: Analysis deletion
      description: Successful deletion of a code scanning analysis
      type: object
      properties:
        next_analysis_url:
          type: string
          description: Next deletable analysis in chain, without last analysis deletion confirmation
          format: uri
          readOnly: true
          example: https://api.github.com/repos/octocat/Hello-World
        confirm_delete_url:
          type: string
          description: Next deletable analysis in chain, with last analysis deletion confirmation
          format: uri
          readOnly: true
          example: https://api.github.com/repos/octocat/Hello-World
      required:
      - next_analysis_url
      - confirm_delete_url
    code-scanning-analysis-created-at:
      type: string
      description: 'The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.'
      format: date-time
      readOnly: true
    code-scanning-ref-full:
      type: string
      description: 'The full Git reference, formatted as `refs/heads/<branch name>`,

        `refs/tags/<tag>`, `refs/pull/<number>/merge`, or `refs/pull/<number>/head`.'
      pattern: ^refs/(heads|tags|pull)/.*$
      example: refs/heads/main
    code-scanning-analysis-commit-sha:
      description: The SHA of the commit to which the analysis you are uploading relates.
      type: string
      minLength: 40
      maxLength: 40
      pattern: ^[0-9a-fA-F]+$
    code-scanning-analysis-tool-guid:
      type: string
      description: The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data.
    code-scanning-analysis-category:
      type: string
      description: Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code.
    code-scanning-analysis-url:
      type: string
      description: The REST API URL of the analysis resource.
      format: uri
      readOnly: true
    code-scanning-analysis-tool:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/code-scanning-analysis-tool-name'
        version:
          $ref: '#/components/schemas/code-scanning-analysis-tool-version'
        guid:
          $ref: '#/components/schemas/code-scanning-analysis-tool-guid'
    code-scanning-ref:
      type: string
      description: 'The Git reference, formatted as `refs/pull/<number>/merge`, `refs/pull/<number>/head`,

        `refs/heads/<branch name>` or simply `<branch name>`.'
    code-scanning-analysis-environment:
      type: string
      description: Identifies the variable values associated with the environment in which this analysis was performed.
  parameters:
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    direction:
      name: direction
      description: The direction to sort the results by.
      in: query
      required: false
      schema:
        type: string
        enum:
        - asc
        - desc
        default: desc
    tool-name:
      name: tool_name
      description: The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_g

# --- truncated at 32 KB (639 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-analysis-api-openapi.yml