Skip to main content

이 버전의 GitHub Enterprise는 다음 날짜에 중단되었습니다. 2024-07-09. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 더 뛰어난 성능, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise Server로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.

이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

GitHub Actions 아티팩트에 대한 REST API 엔드포인트

REST API를 사용하여 GitHub Actions에 대한 아티팩트와 상호 작용합니다.

GitHub Actions

아티팩트 정보

GitHub Actions에서 REST API를 사용하면 워크플로 아티팩트에 대한 정보를 다운로드, 삭제 및 검색할 수 있습니다. Artifacts를 사용하면 워크플로의 작업 간에 데이터를 공유하고 워크플로가 완료되면 데이터를 저장할 수 있습니다. 자세한 정보는 "워크플로 데이터를 아티팩트로 저장"을(를) 참조하세요.

List artifacts for a repository

Lists all artifacts for a repository.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

"List artifacts for a repository"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

쿼리 매개 변수
속성, 형식, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

name string

The name field of an artifact. When specified, only artifacts with this name will be returned.

"List artifacts for a repository"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"List artifacts for a repository"에 대한 코드 샘플

요청 예시

get/repos/{owner}/{repo}/actions/artifacts
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/artifacts

Response

Status: 200
{ "total_count": 2, "artifacts": [ { "id": 11, "node_id": "MDg6QXJ0aWZhY3QxMQ==", "name": "Rails", "size_in_bytes": 556, "url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/11", "archive_download_url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/11/zip", "expired": false, "created_at": "2020-01-10T14:59:22Z", "expires_at": "2020-03-21T14:59:22Z", "updated_at": "2020-02-21T14:59:22Z", "workflow_run": { "id": 2332938, "repository_id": 1296269, "head_repository_id": 1296269, "head_branch": "main", "head_sha": "328faa0536e6fef19753d9d91dc96a9931694ce3" } }, { "id": 13, "node_id": "MDg6QXJ0aWZhY3QxMw==", "name": "Test output", "size_in_bytes": 453, "url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/13", "archive_download_url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/13/zip", "expired": false, "created_at": "2020-01-10T14:59:22Z", "expires_at": "2020-03-21T14:59:22Z", "updated_at": "2020-02-21T14:59:22Z", "workflow_run": { "id": 2332942, "repository_id": 1296269, "head_repository_id": 1296269, "head_branch": "main", "head_sha": "178f4f6090b3fccad4a65b3e83d076a622d59652" } } ] }

Get an artifact

Gets a specific artifact for a workflow run.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

"Get an artifact"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

artifact_id integer Required

The unique identifier of the artifact.

"Get an artifact"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"Get an artifact"에 대한 코드 샘플

요청 예시

get/repos/{owner}/{repo}/actions/artifacts/{artifact_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/artifacts/ARTIFACT_ID

Response

Status: 200
{ "id": 11, "node_id": "MDg6QXJ0aWZhY3QxMQ==", "name": "Rails", "size_in_bytes": 556, "url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/11", "archive_download_url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/11/zip", "expired": false, "created_at": "2020-01-10T14:59:22Z", "expires_at": "2020-01-21T14:59:22Z", "updated_at": "2020-01-21T14:59:22Z", "workflow_run": { "id": 2332938, "repository_id": 1296269, "head_repository_id": 1296269, "head_branch": "main", "head_sha": "328faa0536e6fef19753d9d91dc96a9931694ce3" } }

Delete an artifact

Deletes an artifact for a workflow run. OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

"Delete an artifact"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

artifact_id integer Required

The unique identifier of the artifact.

"Delete an artifact"에 대한 HTTP 응답 상태 코드

상태 코드설명
204

No Content

"Delete an artifact"에 대한 코드 샘플

요청 예시

delete/repos/{owner}/{repo}/actions/artifacts/{artifact_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/artifacts/ARTIFACT_ID

Response

Status: 204

Download an artifact

Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for Location: in the response header to find the URL for the download. The :archive_format must be zip.

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

"Download an artifact"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

artifact_id integer Required

The unique identifier of the artifact.

archive_format string Required

"Download an artifact"에 대한 HTTP 응답 상태 코드

상태 코드설명
302

Found

410

Gone

"Download an artifact"에 대한 코드 샘플

요청 예시

get/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/artifacts/ARTIFACT_ID/ARCHIVE_FORMAT

Response

Status: 302

List workflow run artifacts

Lists artifacts for a workflow run.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

"List workflow run artifacts"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

run_id integer Required

The unique identifier of the workflow run.

쿼리 매개 변수
속성, 형식, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

name string

The name field of an artifact. When specified, only artifacts with this name will be returned.

"List workflow run artifacts"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"List workflow run artifacts"에 대한 코드 샘플

요청 예시

get/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/runs/RUN_ID/artifacts

Response

Status: 200
{ "total_count": 2, "artifacts": [ { "id": 11, "node_id": "MDg6QXJ0aWZhY3QxMQ==", "name": "Rails", "size_in_bytes": 556, "url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/11", "archive_download_url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/11/zip", "expired": false, "created_at": "2020-01-10T14:59:22Z", "expires_at": "2020-03-21T14:59:22Z", "updated_at": "2020-02-21T14:59:22Z", "workflow_run": { "id": 2332938, "repository_id": 1296269, "head_repository_id": 1296269, "head_branch": "main", "head_sha": "328faa0536e6fef19753d9d91dc96a9931694ce3" } }, { "id": 13, "node_id": "MDg6QXJ0aWZhY3QxMw==", "name": "Test output", "size_in_bytes": 453, "url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/13", "archive_download_url": "https://HOSTNAME/repos/octo-org/octo-docs/actions/artifacts/13/zip", "expired": false, "created_at": "2020-01-10T14:59:22Z", "expires_at": "2020-03-21T14:59:22Z", "updated_at": "2020-02-21T14:59:22Z", "workflow_run": { "id": 2332942, "repository_id": 1296269, "head_repository_id": 1296269, "head_branch": "main", "head_sha": "178f4f6090b3fccad4a65b3e83d076a622d59652" } } ] }