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

Method ReleaseFeatures

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

Source from the content-addressed store, hash-verified

529}
530
531func (d *detector) ReleaseFeatures() (ReleaseFeatures, error) {
532 // TODO: immutableReleaseFullSupport
533 // Once all supported GHES versions fully support immutable releases, we can
534 // remove this function, of course, unless there will be other release-related
535 // features that are not available on all GH hosts.
536
537 var releaseFeatureDetection struct {
538 Release struct {
539 Fields []struct {
540 Name string
541 } `graphql:"fields"`
542 } `graphql:"Release: __type(name: \"Release\")"`
543 }
544
545 gql := api.NewClientFromHTTP(d.client())
546 if err := gql.Query(d.host, "Release_fields", &releaseFeatureDetection, nil); err != nil {
547 return ReleaseFeatures{}, err
548 }
549
550 for _, field := range releaseFeatureDetection.Release.Fields {
551 if field.Name == "immutable" {
552 return ReleaseFeatures{
553 ImmutableReleases: true,
554 }, nil
555 }
556 }
557
558 return ReleaseFeatures{}, nil
559}
560
561const (
562 enterpriseWorkflowDispatchRunDetailsSupport = "3.21.0"

Callers

nothing calls this directly

Calls 3

clientMethod · 0.95
NewClientFromHTTPFunction · 0.92
QueryMethod · 0.65

Tested by

no test coverage detected