이 버전의 GitHub Enterprise는 다음 날짜에 중단되었습니다. 2024-03-26. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 더 뛰어난 성능, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise Server로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.
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"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
이름, Type, 설명 |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
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"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
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"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
artifact_id integer RequiredThe unique identifier of the artifact. |
"Get an artifact"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
"Get an artifact"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
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"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
artifact_id integer RequiredThe unique identifier of the artifact. |
"Delete an artifact"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
204 | No Content |
"Delete an artifact"에 대한 코드 샘플
요청 예제
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
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"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
artifact_id integer RequiredThe unique identifier of the artifact. |
archive_format string Required |
"Download an artifact"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
302 | Found |
410 | Gone |
"Download an artifact"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
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"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
run_id integer RequiredThe unique identifier of the workflow run. |
이름, Type, 설명 |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
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"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
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"
}
}
]
}