MCPcopy Create free account
hub / github.com/cli/cli / ReleaseFeatures

Method ReleaseFeatures

internal/featuredetection/feature_detection.go:492–520  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

490}
491
492func (d *detector) ReleaseFeatures() (ReleaseFeatures, error) {
493 // TODO: immutableReleaseFullSupport
494 // Once all supported GHES versions fully support immutable releases, we can
495 // remove this function, of course, unless there will be other release-related
496 // features that are not available on all GH hosts.
497
498 var releaseFeatureDetection struct {
499 Release struct {
500 Fields []struct {
501 Name string
502 } `graphql:"fields"`
503 } `graphql:"Release: __type(name: \"Release\")"`
504 }
505
506 gql := api.NewClientFromHTTP(d.httpClient)
507 if err := gql.Query(d.host, "Release_fields", &releaseFeatureDetection, nil); err != nil {
508 return ReleaseFeatures{}, err
509 }
510
511 for _, field := range releaseFeatureDetection.Release.Fields {
512 if field.Name == "immutable" {
513 return ReleaseFeatures{
514 ImmutableReleases: true,
515 }, nil
516 }
517 }
518
519 return ReleaseFeatures{}, nil
520}
521
522const (
523 enterpriseWorkflowDispatchRunDetailsSupport = "3.21.0"

Callers

nothing calls this directly

Calls 2

NewClientFromHTTPFunction · 0.92
QueryMethod · 0.65

Tested by

no test coverage detected