Skip to content

Commit e1ab684

Browse files
Remove requiment for ActionApp check to workaround GH GraphQL issue (#28)
1 parent 5aa43db commit e1ab684

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

github/manager.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,17 @@ func (gm *Manager) ChangeBranchHead(owner, repo, branch, sha string, force bool)
104104

105105
func checkRunSet(cc int, cn string, edge Edge) int {
106106
for _, checkSuite := range edge.Node.CheckSuites.Nodes {
107-
if checkSuite.App.Name == "GitHub Actions" {
108-
if githubv4.String(cn) == checkSuite.WorkflowRun.Workflow.Name {
109-
if checkSuite.WorkflowRun.CheckSuite.Conclusion == githubv4.String(githubv4.StatusStateSuccess) {
110-
cc++
111-
}
107+
if (checkSuite.WorkflowRun != WorkflowRun{}) && githubv4.String(cn) == checkSuite.WorkflowRun.Workflow.Name {
108+
if checkSuite.WorkflowRun.CheckSuite.Conclusion == githubv4.String(githubv4.StatusStateSuccess) {
109+
cc++
110+
continue
112111
}
113-
} else {
114-
for _, checkRuns := range checkSuite.CheckRuns.Nodes {
115-
if githubv4.String(cn) == checkRuns.Name {
116-
if checkRuns.Conclusion == githubv4.String(githubv4.StatusStateSuccess) {
117-
cc++
118-
}
112+
}
113+
114+
for _, checkRuns := range checkSuite.CheckRuns.Nodes {
115+
if githubv4.String(cn) == checkRuns.Name {
116+
if checkRuns.Conclusion == githubv4.String(githubv4.StatusStateSuccess) {
117+
cc++
119118
}
120119
}
121120
}

github/types.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,8 @@ type WorkflowRun struct {
3131
CheckSuite CheckSuite
3232
}
3333

34-
// ActionApp represents the information about the Github Action App
35-
type ActionApp struct {
36-
Name githubv4.String
37-
}
38-
3934
// CheckSuiteNode represents the information about the check suite information of the Node
4035
type CheckSuiteNode struct {
41-
App ActionApp
4236
WorkflowRun WorkflowRun
4337
CheckRuns CheckRuns `graphql:"checkRuns(first: 25)"`
4438
}

0 commit comments

Comments
 (0)