Skip to content

Implement Actions API. #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
91b9f67
Implement actions->artifacts API.
K0Te Jun 22, 2021
f1e9513
Up
K0Te Jul 16, 2022
b1ab2df
Cleanup
K0Te Jul 17, 2022
d094b17
Actions - cache.
K0Te Jul 17, 2022
7b18e83
Actions - artifacts and cache.
K0Te Oct 31, 2022
9cf8f3b
Secrets
K0Te Nov 11, 2022
e74a861
Workflows.
K0Te Nov 12, 2022
6352003
WorkflowJobs.
K0Te Nov 12, 2022
afad670
Merge branch 'master' into github-actions-2
andreasabel Nov 12, 2022
2811abb
WorkflowRuns.
K0Te Nov 13, 2022
0661ca1
Format
K0Te Nov 13, 2022
ed61cc1
Artifacts QA.
K0Te Nov 14, 2022
50f7fa1
Cache QA.
K0Te Nov 14, 2022
d02bed9
Secrets QA.
K0Te Nov 21, 2022
90ac4b4
WorkflowJobs QA.
K0Te Nov 21, 2022
d56b38d
Workflows QA.
K0Te Nov 21, 2022
1012da2
Format.
K0Te Nov 21, 2022
3f83775
Drop slack-related files.
K0Te Nov 21, 2022
7212468
Format JSON
K0Te Nov 21, 2022
72acb62
Support workflow name in workflowRunsForWorkflowR.
K0Te Nov 28, 2022
c329f88
Support workflow name in Workflows.hs.
K0Te Nov 28, 2022
42418cc
Fix
K0Te Nov 28, 2022
7d7ea3c
Fix
K0Te Nov 28, 2022
c6833bf
Do not parse pull requests from workflow runs.
K0Te Nov 30, 2022
4c995da
Avoid parsing 'trigerring_actor', it is sometimes missing.
K0Te Nov 30, 2022
7838a81
Fix workflow run conclusion parsing.
K0Te Nov 30, 2022
0071e3d
Merge branch 'master' into github-actions-2
andreasabel Jun 23, 2023
a24393c
Whitespace and lexical changes only
andreasabel Jun 23, 2023
148d0f4
Merge branch 'master' into github-actions-2
andreasabel Jun 23, 2023
c4ac51c
Remove outdated maintainer from module headers
andreasabel Jun 23, 2023
21f2904
Whitespace: align code
andreasabel Jun 23, 2023
62bec02
Merge branch 'master' into github-actions-2
andreasabel Jun 23, 2023
9e2b148
Bump cabal-version to 2.4 for globbing
andreasabel Jun 23, 2023
6b9d05e
Cosmetics: use (<&>)
andreasabel Jun 23, 2023
6a03ecc
Restore upper bounds for openssl etc. in .cabal file
andreasabel Jun 23, 2023
2a4ddc0
Whitespace
andreasabel Jun 23, 2023
8efa8b6
Add haddocks for WithTotalCount
andreasabel Jun 24, 2023
9837d4c
Changelog for PR #459
andreasabel Jun 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ run.sh
src/hightlight.js
src/style.css
TAGS
.DS_Store

8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## Changes for 0.29

_2022-06-24, Andreas Abel, Midsommar edition_
_2023-06-24, Andreas Abel, Midsommar edition_

- Support for the GitHub Actions API
(PR [#459](https://github.com/haskell-github/github/pull/459)):
* New endpoint modules `GitHub.EndPoints.Actions.Artifacts`, `.Cache`,
`.Secrets`, `.Workflows`, `.WorkflowRuns`, `.WorkflowJobs`.
* Matching data structure modules `GitHub.Data.Actions.*`.

- Add field `issueStateReason` of type `Maybe IssueStateReason` to `Issue`
with possible values `completed`, `not_planned` and `reopened`
Expand Down
19 changes: 19 additions & 0 deletions fixtures/actions/artifact.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": 416767789,
"node_id": "MDg6QXJ0aWZhY3Q0MTY3Njc3ODk=",
"name": "dist-without-markdown",
"size_in_bytes": 42718,
"url": "https://api.github.com/repos/kote-test-org-actions/actions-api/actions/artifacts/416767789",
"archive_download_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/actions/artifacts/416767789/zip",
"expired": false,
"created_at": "2022-10-29T22:18:21Z",
"updated_at": "2022-10-29T22:18:23Z",
"expires_at": "2023-01-27T22:18:16Z",
"workflow_run": {
"id": 3353148947,
"repository_id": 559365297,
"head_repository_id": 559365297,
"head_branch": "main",
"head_sha": "601593ecb1d8a57a04700fdb445a28d4186b8954"
}
}
43 changes: 43 additions & 0 deletions fixtures/actions/artifacts-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"total_count": 23809,
"artifacts": [
{
"id": 416737084,
"node_id": "MDg6QXJ0aWZhY3Q0MTY3MzcwODQ=",
"name": "doc-html",
"size_in_bytes": 61667543,
"url": "https://api.github.com/repos/python/cpython/actions/artifacts/416737084",
"archive_download_url": "https://api.github.com/repos/python/cpython/actions/artifacts/416737084/zip",
"expired": false,
"created_at": "2022-10-29T20:56:24Z",
"updated_at": "2022-10-29T20:56:25Z",
"expires_at": "2023-01-27T20:50:21Z",
"workflow_run": {
"id": 3352897496,
"repository_id": 81598961,
"head_repository_id": 101955313,
"head_branch": "backport-bfecff5-3.11",
"head_sha": "692cd77975413d71ff0951072df686e6f38711c8"
}
},
{
"id": 416712612,
"node_id": "MDg6QXJ0aWZhY3Q0MTY3MTI2MTI=",
"name": "doc-html",
"size_in_bytes": 61217330,
"url": "https://api.github.com/repos/python/cpython/actions/artifacts/416712612",
"archive_download_url": "https://api.github.com/repos/python/cpython/actions/artifacts/416712612/zip",
"expired": false,
"created_at": "2022-10-29T19:53:19Z",
"updated_at": "2022-10-29T19:53:20Z",
"expires_at": "2023-01-27T19:49:12Z",
"workflow_run": {
"id": 3352724493,
"repository_id": 81598961,
"head_repository_id": 559335486,
"head_branch": "patch-1",
"head_sha": "62eb88a66d1d35f7701873d8b698a2f8d7e84fa5"
}
}
]
}
14 changes: 14 additions & 0 deletions fixtures/actions/cache-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"total_count": 1,
"actions_caches": [
{
"id": 1,
"ref": "refs/heads/main",
"key": "cache_key",
"version": "f5f850afdadd47730296d4ffa900de95f6bbafb75dc1e8475df1fa6ae79dcece",
"last_accessed_at": "2022-10-30T00:08:14.223333300Z",
"created_at": "2022-10-30T00:08:14.223333300Z",
"size_in_bytes": 26586
}
]
}
4 changes: 4 additions & 0 deletions fixtures/actions/org-cache-usage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"total_active_caches_size_in_bytes": 26586,
"total_active_caches_count": 1
}
4 changes: 4 additions & 0 deletions fixtures/actions/org-public-key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"key_id": "568250167242549743",
"key": "KHVvOxB765kjkShEgUu27QCzl5XxKz/L20V+KRsWf0w="
}
18 changes: 18 additions & 0 deletions fixtures/actions/org-secrets-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"total_count": 2,
"secrets": [
{
"name": "TEST_SECRET",
"created_at": "2022-10-31T00:08:12Z",
"updated_at": "2022-10-31T00:08:12Z",
"visibility": "all"
},
{
"name": "TEST_SELECTED",
"created_at": "2022-10-31T00:08:43Z",
"updated_at": "2022-10-31T00:08:43Z",
"visibility": "selected",
"selected_repositories_url": "https://api.github.com/orgs/kote-test-org-actions/actions/secrets/TEST_SELECTED/repositories"
}
]
}
5 changes: 5 additions & 0 deletions fixtures/actions/repo-cache-usage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"full_name": "python/cpython",
"active_caches_size_in_bytes": 55000268087,
"active_caches_count": 171
}
72 changes: 72 additions & 0 deletions fixtures/actions/selected-repositories-for-secret.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"total_count": 1,
"repositories": [
{
"id": 559365297,
"node_id": "R_kgDOIVc8sQ",
"name": "actions-api",
"full_name": "kote-test-org-actions/actions-api",
"private": true,
"owner": {
"login": "kote-test-org-actions",
"id": 116976977,
"node_id": "O_kgDOBvjtUQ",
"avatar_url": "https://avatars.githubusercontent.com/u/116976977?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kote-test-org-actions",
"html_url": "https://github.com/kote-test-org-actions",
"followers_url": "https://api.github.com/users/kote-test-org-actions/followers",
"following_url": "https://api.github.com/users/kote-test-org-actions/following{/other_user}",
"gists_url": "https://api.github.com/users/kote-test-org-actions/gists{/gist_id}",
"starred_url": "https://api.github.com/users/kote-test-org-actions/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kote-test-org-actions/subscriptions",
"organizations_url": "https://api.github.com/users/kote-test-org-actions/orgs",
"repos_url": "https://api.github.com/users/kote-test-org-actions/repos",
"events_url": "https://api.github.com/users/kote-test-org-actions/events{/privacy}",
"received_events_url": "https://api.github.com/users/kote-test-org-actions/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/kote-test-org-actions/actions-api",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/kote-test-org-actions/actions-api",
"forks_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/forks",
"keys_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/teams",
"hooks_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/hooks",
"issue_events_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/issues/events{/number}",
"events_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/events",
"assignees_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/assignees{/user}",
"branches_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/branches{/branch}",
"tags_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/tags",
"blobs_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/statuses/{sha}",
"languages_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/languages",
"stargazers_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/stargazers",
"contributors_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/contributors",
"subscribers_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/subscribers",
"subscription_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/subscription",
"commits_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/contents/{+path}",
"compare_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/merges",
"archive_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/downloads",
"issues_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/issues{/number}",
"pulls_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/pulls{/number}",
"milestones_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/milestones{/number}",
"notifications_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/labels{/name}",
"releases_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/releases{/id}",
"deployments_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/deployments"
}
]
}
113 changes: 113 additions & 0 deletions fixtures/actions/workflow-job.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"id": 9183275828,
"run_id": 3353449941,
"run_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/actions/runs/3353449941",
"run_attempt": 1,
"node_id": "CR_kwDOIVc8sc8AAAACI12rNA",
"head_sha": "3156f684232a3adec5085c920d2006aca80f2798",
"url": "https://api.github.com/repos/kote-test-org-actions/actions-api/actions/jobs/9183275828",
"html_url": "https://github.com/kote-test-org-actions/actions-api/actions/runs/3353449941/jobs/5556228789",
"status": "completed",
"conclusion": "success",
"started_at": "2022-10-30T00:09:29Z",
"completed_at": "2022-10-30T00:09:49Z",
"name": "check-bats-version",
"steps": [
{
"name": "Set up job",
"status": "completed",
"conclusion": "success",
"number": 1,
"started_at": "2022-10-29T17:09:29.000-07:00",
"completed_at": "2022-10-29T17:09:32.000-07:00"
},
{
"name": "Run actions/checkout@v3",
"status": "completed",
"conclusion": "success",
"number": 2,
"started_at": "2022-10-29T17:09:32.000-07:00",
"completed_at": "2022-10-29T17:09:33.000-07:00"
},
{
"name": "Run actions/setup-node@v3",
"status": "completed",
"conclusion": "success",
"number": 3,
"started_at": "2022-10-29T17:09:34.000-07:00",
"completed_at": "2022-10-29T17:09:39.000-07:00"
},
{
"name": "Run npm install -g bats",
"status": "completed",
"conclusion": "success",
"number": 4,
"started_at": "2022-10-29T17:09:40.000-07:00",
"completed_at": "2022-10-29T17:09:42.000-07:00"
},
{
"name": "Run bats -v",
"status": "completed",
"conclusion": "success",
"number": 5,
"started_at": "2022-10-29T17:09:42.000-07:00",
"completed_at": "2022-10-29T17:09:42.000-07:00"
},
{
"name": "Archive Test",
"status": "completed",
"conclusion": "success",
"number": 6,
"started_at": "2022-10-29T17:09:42.000-07:00",
"completed_at": "2022-10-29T17:09:46.000-07:00"
},
{
"name": "Cache",
"status": "completed",
"conclusion": "success",
"number": 7,
"started_at": "2022-10-29T17:09:46.000-07:00",
"completed_at": "2022-10-29T17:09:47.000-07:00"
},
{
"name": "Post Cache",
"status": "completed",
"conclusion": "success",
"number": 12,
"started_at": "2022-10-29T17:09:49.000-07:00",
"completed_at": "2022-10-29T17:09:47.000-07:00"
},
{
"name": "Post Run actions/setup-node@v3",
"status": "completed",
"conclusion": "success",
"number": 13,
"started_at": "2022-10-29T17:09:49.000-07:00",
"completed_at": "2022-10-29T17:09:49.000-07:00"
},
{
"name": "Post Run actions/checkout@v3",
"status": "completed",
"conclusion": "success",
"number": 14,
"started_at": "2022-10-29T17:09:49.000-07:00",
"completed_at": "2022-10-29T17:09:49.000-07:00"
},
{
"name": "Complete job",
"status": "completed",
"conclusion": "success",
"number": 15,
"started_at": "2022-10-29T17:09:47.000-07:00",
"completed_at": "2022-10-29T17:09:47.000-07:00"
}
],
"check_run_url": "https://api.github.com/repos/kote-test-org-actions/actions-api/check-runs/9183275828",
"labels": [
"ubuntu-latest"
],
"runner_id": 1,
"runner_name": "Hosted Agent",
"runner_group_id": 2,
"runner_group_name": "GitHub Actions"
}
17 changes: 17 additions & 0 deletions fixtures/actions/workflow-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"total_count": 1,
"workflows": [
{
"id": 39065091,
"node_id": "W_kwDOIVc8sc4CVBYD",
"name": "learn-github-actions",
"path": ".github/workflows/make_artifact.yaml",
"state": "active",
"created_at": "2022-10-29T15:17:59.000-07:00",
"updated_at": "2022-10-29T15:17:59.000-07:00",
"url": "https://api.github.com/repos/kote-test-org-actions/actions-api/actions/workflows/39065091",
"html_url": "https://github.com/kote-test-org-actions/actions-api/blob/main/.github/workflows/make_artifact.yaml",
"badge_url": "https://github.com/kote-test-org-actions/actions-api/workflows/learn-github-actions/badge.svg"
}
]
}
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy