Open Context Protocol is live! 🚀 Read the launch post
secretScanningGetScanHistory

secretScanningGetScanHistory

Get secret scanning scan history for a repository

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/secret-scanning/scan-history
  • Operation ID: secret-scanning/get-scan-history

Parameters

{
  "owner": {
    "description": "The account owner of the repository. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "repo": {
    "description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  }
}

Response Schema

{
  "type": "object",
  "properties": {
    "incremental_scans": {
      "type": "array",
      "items": {
        "description": "Information on a single scan performed by secret scanning on the repository",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of scan"
          },
          "status": {
            "type": "string",
            "description": "The state of the scan. Either \"completed\", \"running\", or \"pending\""
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time that the scan was completed. Empty if the scan is running",
            "nullable": true
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time that the scan was started. Empty if the scan is pending",
            "nullable": true
          }
        }
      }
    },
    "pattern_update_scans": {
      "type": "array",
      "items": {
        "description": "Information on a single scan performed by secret scanning on the repository",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of scan"
          },
          "status": {
            "type": "string",
            "description": "The state of the scan. Either \"completed\", \"running\", or \"pending\""
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time that the scan was completed. Empty if the scan is running",
            "nullable": true
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time that the scan was started. Empty if the scan is pending",
            "nullable": true
          }
        }
      }
    },
    "backfill_scans": {
      "type": "array",
      "items": {
        "description": "Information on a single scan performed by secret scanning on the repository",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of scan"
          },
          "status": {
            "type": "string",
            "description": "The state of the scan. Either \"completed\", \"running\", or \"pending\""
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time that the scan was completed. Empty if the scan is running",
            "nullable": true
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time that the scan was started. Empty if the scan is pending",
            "nullable": true
          }
        }
      }
    },
    "custom_pattern_backfill_scans": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "description": "Information on a single scan performed by secret scanning on the repository",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "The type of scan"
              },
              "status": {
                "type": "string",
                "description": "The state of the scan. Either \"completed\", \"running\", or \"pending\""
              },
              "completed_at": {
                "type": "string",
                "format": "date-time",
                "description": "The time that the scan was completed. Empty if the scan is running",
                "nullable": true
              },
              "started_at": {
                "type": "string",
                "format": "date-time",
                "description": "The time that the scan was started. Empty if the scan is pending",
                "nullable": true
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "pattern_name": {
                "type": "string",
                "description": "Name of the custom pattern for custom pattern scans"
              },
              "pattern_scope": {
                "type": "string",
                "description": "Level at which the custom pattern is defined, one of \"repository\", \"organization\", or \"enterprise\""
              }
            }
          }
        ]
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('secretScanningGetScanHistory', {
    # Add required parameters here
})