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

actionsListWorkflowRunArtifacts

List workflow run artifacts

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts
  • Operation ID: actions/list-workflow-run-artifacts

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"
  },
  "run_id": {
    "description": "The unique identifier of the workflow run.",
    "required": true,
    "location": "path",
    "type": "integer"
  },
  "per_page": {
    "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "page": {
    "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "name": {
    "description": "The name field of an artifact. When specified, only artifacts with this name will be returned.",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "type": "object",
  "required": [
    "total_count",
    "artifacts"
  ],
  "properties": {
    "total_count": {
      "type": "integer"
    },
    "artifacts": {
      "type": "array",
      "items": {
        "title": "Artifact",
        "description": "An artifact",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 5
          },
          "node_id": {
            "type": "string",
            "example": "MDEwOkNoZWNrU3VpdGU1"
          },
          "name": {
            "description": "The name of the artifact.",
            "type": "string",
            "example": "AdventureWorks.Framework"
          },
          "size_in_bytes": {
            "description": "The size in bytes of the artifact.",
            "type": "integer",
            "example": 12345
          },
          "url": {
            "type": "string",
            "example": "https://api.github.com/repos/github/hello-world/actions/artifacts/5"
          },
          "archive_download_url": {
            "type": "string",
            "example": "https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip"
          },
          "expired": {
            "description": "Whether or not the artifact has expired.",
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "digest": {
            "type": "string",
            "description": "The SHA256 digest of the artifact. This field will only be populated on artifacts uploaded with upload-artifact v4 or newer. For older versions, this field will be null.",
            "nullable": true,
            "example": "sha256:cfc3236bdad15b5898bca8408945c9e19e1917da8704adc20eaa618444290a8c"
          },
          "workflow_run": {
            "type": "object",
            "nullable": true,
            "properties": {
              "id": {
                "example": 10,
                "type": "integer"
              },
              "repository_id": {
                "example": 42,
                "type": "integer"
              },
              "head_repository_id": {
                "example": 42,
                "type": "integer"
              },
              "head_branch": {
                "example": "main",
                "type": "string"
              },
              "head_sha": {
                "example": "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d",
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id",
          "node_id",
          "name",
          "size_in_bytes",
          "url",
          "archive_download_url",
          "expired",
          "created_at",
          "expires_at",
          "updated_at"
        ]
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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