-
Notifications
You must be signed in to change notification settings - Fork 194
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
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
91b9f67
Implement actions->artifacts API.
K0Te f1e9513
Up
K0Te b1ab2df
Cleanup
K0Te d094b17
Actions - cache.
K0Te 7b18e83
Actions - artifacts and cache.
K0Te 9cf8f3b
Secrets
K0Te e74a861
Workflows.
K0Te 6352003
WorkflowJobs.
K0Te afad670
Merge branch 'master' into github-actions-2
andreasabel 2811abb
WorkflowRuns.
K0Te 0661ca1
Format
K0Te ed61cc1
Artifacts QA.
K0Te 50f7fa1
Cache QA.
K0Te d02bed9
Secrets QA.
K0Te 90ac4b4
WorkflowJobs QA.
K0Te d56b38d
Workflows QA.
K0Te 1012da2
Format.
K0Te 3f83775
Drop slack-related files.
K0Te 7212468
Format JSON
K0Te 72acb62
Support workflow name in workflowRunsForWorkflowR.
K0Te c329f88
Support workflow name in Workflows.hs.
K0Te 42418cc
Fix
K0Te 7d7ea3c
Fix
K0Te c6833bf
Do not parse pull requests from workflow runs.
K0Te 4c995da
Avoid parsing 'trigerring_actor', it is sometimes missing.
K0Te 7838a81
Fix workflow run conclusion parsing.
K0Te 0071e3d
Merge branch 'master' into github-actions-2
andreasabel a24393c
Whitespace and lexical changes only
andreasabel 148d0f4
Merge branch 'master' into github-actions-2
andreasabel c4ac51c
Remove outdated maintainer from module headers
andreasabel 21f2904
Whitespace: align code
andreasabel 62bec02
Merge branch 'master' into github-actions-2
andreasabel 9e2b148
Bump cabal-version to 2.4 for globbing
andreasabel 6b9d05e
Cosmetics: use (<&>)
andreasabel 6a03ecc
Restore upper bounds for openssl etc. in .cabal file
andreasabel 2a4ddc0
Whitespace
andreasabel 8efa8b6
Add haddocks for WithTotalCount
andreasabel 9837d4c
Changelog for PR #459
andreasabel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Up
- Loading branch information
commit f1e951373e7ec7e7f08c0b16c2d917334a6eb61d
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,3 +14,4 @@ cabal.sandbox.config | |
| run.sh | ||
| src/hightlight.js | ||
| src/style.css | ||
| .DS_Store | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| cradle: | ||
| stack: | ||
| - path: "./src" | ||
| component: "github:lib" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| ----------------------------------------------------------------------------- | ||
| -- | | ||
| -- License : BSD-3-Clause | ||
| -- Maintainer : Oleg Grenrus <[email protected]> | ||
andreasabel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| -- | ||
| -- The actions API as documented at | ||
| -- <https://docs.github.com/en/rest/reference/actions>. | ||
| module GitHub.Endpoints.Actions.Cache ( | ||
| cachesForRepoR, | ||
| deleteCacheR, | ||
| module GitHub.Data | ||
| ) where | ||
|
|
||
| import GitHub.Data | ||
| import GitHub.Internal.Prelude | ||
| import Network.URI (URI) | ||
| import Prelude () | ||
| -- import GitHub.Data.Actions (ActionWorkflow, ActionWorkflowResult, ActionWorkflowRun, Workflow, ActionWorkflowRunResult, CreateWorkflowDispatchEvent) | ||
|
|
||
| -- -- | List artifacts for repository. | ||
| -- -- See <https://docs.github.com/en/rest/reference/actions#list-artifacts-for-a-repository> | ||
| -- artifactsForR | ||
| -- :: Name Owner | ||
| -- -> Name Repo | ||
| -- -> FetchCount | ||
| -- -> Request k (WithTotalCount Artifact) | ||
| -- artifactsForR user repo = PagedQuery | ||
| -- ["repos", toPathPart user, toPathPart repo, "actions", "artifacts"] | ||
| -- [] | ||
|
|
||
|
|
||
| -- -- | Query a single artifact. | ||
| -- -- See <https://docs.github.com/en/rest/reference/actions#get-an-artifact> | ||
| -- artifactR :: Name Owner -> Name Repo -> Id Artifact -> Request k Artifact | ||
| -- artifactR user repo artid = | ||
| -- query ["repos", toPathPart user, toPathPart repo, "actions", "artifacts", toPathPart artid] [] | ||
|
|
||
|
|
||
| -- -- | Download an artifact. | ||
| -- -- See <https://docs.github.com/en/rest/reference/actions#download-an-artifact> | ||
| -- downloadArtifactR :: Name Owner -> Name Repo -> Id Artifact -> GenRequest 'MtRedirect 'RW URI | ||
| -- downloadArtifactR user repo artid = | ||
| -- Query ["repos", toPathPart user, toPathPart repo, "actions", "artifacts", toPathPart artid, "zip"] [] | ||
|
|
||
| -- | List the GitHub Actions caches for a repository. | ||
| -- See <https://docs.github.com/en/rest/actions/cache#list-github-actions-caches-for-a-repository> | ||
| cachesForRepoR | ||
| :: Name Owner | ||
| -> Name Repo | ||
| -> CacheMod | ||
| -> FetchCount | ||
| -> GenRequest 'MtJSON 'RA (WithTotalCount Cache) | ||
| cachesForRepoR user repo opts = PagedQuery | ||
| ["repos", toPathPart user, toPathPart repo, "actions", "caches"] | ||
| (cacheModToQueryString opts) | ||
|
|
||
| -- | Delete GitHub Actions cache for a repository. | ||
| -- See <https://docs.github.com/en/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key> | ||
| -- TODO: No querystring for Commands??? | ||
| -- TODO: return value | ||
| -- deleteCachesKeyR :: Name Owner -> Name Repo -> String -> Maybe String -> GenRequest 'MtUnit 'RW () | ||
| -- deleteCachesKeyR user repo key ref = | ||
| -- Command Delete parts mempty | ||
| -- where | ||
| -- parts = ["repos", toPathPart user, toPathPart repo, "actions", "caches"] | ||
|
|
||
| -- | Delete GitHub Actions cache for a repository. | ||
| -- See <https://docs.github.com/en/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id> | ||
| deleteCacheR :: Name Owner -> Name Repo -> Id Cache -> GenRequest 'MtUnit 'RW () | ||
| deleteCacheR user repo cacheid = | ||
| Command Delete parts mempty | ||
| where | ||
| parts = ["repos", toPathPart user, toPathPart repo, "actions", "caches", toPathPart cacheid] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.