-
Notifications
You must be signed in to change notification settings - Fork 4
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
[WIP] Specifiable targets - graphql-codegen #475
Conversation
Struggling with API and schema is an annoy task to me, ChatGPT helped me a lot 😇 query GetCheckRuns($commitSha: String!) {
repository(owner: "kachick", name: "wait-other-jobs") {
object(expression: $commitSha) {
... on Commit {
checkSuites(first: 10) {
edges {
node {
id
status
conclusion
workflowRun {
id
databaseId
createdAt
workflow {
id
databaseId
name
resourcePath
url
}
}
checkRuns(first: 10) {
edges {
node {
id
databaseId
name
status
conclusion
startedAt
completedAt
}
}
}
}
}
}
}
}
}
} {
"commitSha": "4686c4074b62976294e65cd06eafd7429784ff02"
} {
"data": {
"repository": {
"object": {
"checkSuites": {
"edges": [
{
"node": {
"id": "CS_kwDOHZ9uqs8AAAAC-PmvVA",
"status": "QUEUED",
"conclusion": null,
"workflowRun": null,
"checkRuns": {
"edges": []
}
}
},
{
"node": {
"id": "CS_kwDOHZ9uqs8AAAAC-PmvYg",
"status": "QUEUED",
"conclusion": null,
"workflowRun": null,
"checkRuns": {
"edges": []
}
}
},
{
"node": {
"id": "CS_kwDOHZ9uqs8AAAAC-Pm0GA",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"workflowRun": {
"id": "WFR_kwLOHZ9uqs8AAAABJXjfEg",
"databaseId": 4923645714,
"createdAt": "2023-05-09T07:46:31Z",
"workflow": {
"id": "W_kwDOHZ9uqs4BxDg_",
"databaseId": 29636671,
"name": "Itself",
"resourcePath": "/kachick/wait-other-jobs/actions/workflows/itself.yml",
"url": "https://github.com/kachick/wait-other-jobs/actions/workflows/itself.yml"
}
},
"checkRuns": {
"edges": [
{
"node": {
"id": "CR_kwDOHZ9uqs8AAAADGuI-WQ",
"databaseId": 13335936601,
"name": "equal_intervals",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"startedAt": "2023-05-09T07:46:38Z",
"completedAt": "2023-05-09T07:47:01Z"
}
},
{
"node": {
"id": "CR_kwDOHZ9uqs8AAAADGuJoRw",
"databaseId": 13335947335,
"name": "default",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"startedAt": "2023-05-09T07:47:10Z",
"completedAt": "2023-05-09T07:47:43Z"
}
}
]
}
}
},
{
"node": {
"id": "CS_kwDOHZ9uqs8AAAAC-Pm0Gg",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"workflowRun": {
"id": "WFR_kwLOHZ9uqs8AAAABJXjfEA",
"databaseId": 4923645712,
"createdAt": "2023-05-09T07:46:31Z",
"workflow": {
"id": "W_kwDOHZ9uqs4BwmnU",
"databaseId": 29518292,
"name": "Format",
"resourcePath": "/kachick/wait-other-jobs/actions/workflows/format.yml",
"url": "https://github.com/kachick/wait-other-jobs/actions/workflows/format.yml"
}
},
"checkRuns": {
"edges": [
{
"node": {
"id": "CR_kwDOHZ9uqs8AAAADGuI-Yw",
"databaseId": 13335936611,
"name": "format",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"startedAt": "2023-05-09T07:46:40Z",
"completedAt": "2023-05-09T07:46:51Z"
}
}
]
}
}
},
{
"node": {
"id": "CS_kwDOHZ9uqs8AAAAC-Pm0KQ",
"status": "COMPLETED",
"conclusion": "SKIPPED",
"workflowRun": {
"id": "WFR_kwLOHZ9uqs8AAAABJXjfGA",
"databaseId": 4923645720,
"createdAt": "2023-05-09T07:46:31Z",
"workflow": {
"id": "W_kwDOHZ9uqs4CVGGg",
"databaseId": 39084448,
"name": "Merge bot PR after CI",
"resourcePath": "/kachick/wait-other-jobs/actions/workflows/merge-bot-pr.yml",
"url": "https://github.com/kachick/wait-other-jobs/actions/workflows/merge-bot-pr.yml"
}
},
"checkRuns": {
"edges": [
{
"node": {
"id": "CR_kwDOHZ9uqs8AAAADGuI-ag",
"databaseId": 13335936618,
"name": "dependabot",
"status": "COMPLETED",
"conclusion": "NEUTRAL",
"startedAt": "2023-05-09T07:46:32Z",
"completedAt": "2023-05-09T07:46:32Z"
}
},
{
"node": {
"id": "CR_kwDOHZ9uqs8AAAADGuI_Tg",
"databaseId": 13335936846,
"name": "renovate",
"status": "COMPLETED",
"conclusion": "NEUTRAL",
"startedAt": "2023-05-09T07:46:33Z",
"completedAt": "2023-05-09T07:46:33Z"
}
}
]
}
}
},
{
"node": {
"id": "CS_kwDOHZ9uqs8AAAAC-Pm0LA",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"workflowRun": {
"id": "WFR_kwLOHZ9uqs8AAAABJXjfFw",
"databaseId": 4923645719,
"createdAt": "2023-05-09T07:46:31Z",
"workflow": {
"id": "W_kwDOHZ9uqs4CuLDV",
"databaseId": 45658325,
"name": "CI",
"resourcePath": "/kachick/wait-other-jobs/actions/workflows/ci.yml",
"url": "https://github.com/kachick/wait-other-jobs/actions/workflows/ci.yml"
}
},
"checkRuns": {
"edges": [
{
"node": {
"id": "CR_kwDOHZ9uqs8AAAADGuI-Ww",
"databaseId": 13335936603,
"name": "typecheck",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"startedAt": "2023-05-09T07:46:40Z",
"completedAt": "2023-05-09T07:47:01Z"
}
},
{
"node": {
"id": "CR_kwDOHZ9uqs8AAAADGuJnEQ",
"databaseId": 13335947025,
"name": "lint",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"startedAt": "2023-05-09T07:47:09Z",
"completedAt": "2023-05-09T07:47:29Z"
}
},
{
"node": {
"id": "CR_kwDOHZ9uqs8AAAADGuJnuw",
"databaseId": 13335947195,
"name": "build",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"startedAt": "2023-05-09T07:47:07Z",
"completedAt": "2023-05-09T07:47:26Z"
}
}
]
}
}
}
]
}
}
}
}
} -- Below is the original response with 🤖 --
Sure! Here's an example GraphQL query you can use to get GitHub check run states and conclusions from a given commit SHA: query GetCheckRuns($commitSha: String!) {
repository(owner: "owner_name", name: "repository_name") {
object(expression: $commitSha) {
... on Commit {
checkSuites(first: 10) {
edges {
node {
id
status
conclusion
checkRuns(first: 10) {
edges {
node {
id
name
status
conclusion
}
}
}
}
}
}
}
}
}
} In this query, you will need to replace "owner_name" and "repository_name" with the appropriate values for your repository. You will also need to pass the commit SHA as a variable called "commitSha" when executing the query. The query uses the Within each check suite, the query also uses the Note that this query only retrieves the first 10 check suites and first 10 check runs for each suite. You can adjust these limits as needed by modifying the |
It is annoy when I have long WIP PR as #475 ...
I may continue this PR after GitHub Actions will work in Node.js 20. kachick/action-typescript-template#387 wait-other-jobs/CONTRIBUTING.md Lines 86 to 93 in 5896a73
|
Resolves #474
Looks still nothing inGraphQL: https://docs.github.com/en/graphql/overview/explorerREST based API needs to get workflow names as https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28
List does not show useful props.
Getting from the filename is a way. But might make N+1 query