Skip to content

Bug: does not observe required checks #73

@hfaulds

Description

@hfaulds

At the moment deploys are blocked on all status checks passing, even if they're not required.

This is because statusCheckRollup.state doesn't care about whether a check is required or not:

https://github.com/github/branch-deploy/blob/43afd75c657a06c55c953cc7af493d9cf565aa43/src/functions/prechecks.js#LL151

I don't know if there's an elegant way to check this 😢 (especially one that avoids paging through results). The best graphql I could come up with was this:

{
  repository(owner: "github", name: "branch-deploy") {
    pullRequest(number: 69) {
      reviewDecision
      commits(last: 1) {
        nodes {
          commit {
            checkSuites {
              totalCount
            }
            statusCheckRollup {
              state
              contexts(first: 100) {
                nodes {
                  ... on CheckRun {
                    isRequired(pullRequestNumber: 69)
                    conclusion
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions