diff options
author | 2023-09-07 17:24:11 +0800 | |
---|---|---|
committer | 2023-09-07 17:24:11 +0800 | |
commit | 30114ade84c18aba40454c8dd42dc8268ec80794 (patch) | |
tree | 2c59d4d6ab32fdf67d85c89e9dbfc2a632993c2c /source/features/github-actions-indicators.tsx | |
parent | a62b707f3d893f424458b9453e938071e4271c6e (diff) | |
download | refined-github-30114ade84c18aba40454c8dd42dc8268ec80794.tar.gz refined-github-30114ade84c18aba40454c8dd42dc8268ec80794.tar.zst refined-github-30114ade84c18aba40454c8dd42dc8268ec80794.zip |
Meta: Extract GQL queries (#6879)23.9.7
Diffstat (limited to 'source/features/github-actions-indicators.tsx')
-rw-r--r-- | source/features/github-actions-indicators.tsx | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/source/features/github-actions-indicators.tsx b/source/features/github-actions-indicators.tsx index f90b7a70..896195e1 100644 --- a/source/features/github-actions-indicators.tsx +++ b/source/features/github-actions-indicators.tsx @@ -9,6 +9,7 @@ import features from '../feature-manager.js'; import api from '../github-helpers/api.js'; import {cacheByRepo} from '../github-helpers/index.js'; import observe from '../helpers/selector-observer.js'; +import GetWorkflows from './github-actions-indicators.gql'; type Workflow = { name: string; @@ -45,22 +46,7 @@ async function getWorkflows(): Promise<Workflow[]> { } async function getFilesInWorkflowPath(): Promise<Record<string, string>> { - const {repository: {workflowFiles}} = await api.v4(` - repository() { - workflowFiles: object(expression: "HEAD:.github/workflows") { - ... on Tree { - entries { - name - object { - ... on Blob { - text - } - } - } - } - } - } - `); + const {repository: {workflowFiles}} = await api.v4(GetWorkflows); const workflows: any[] = workflowFiles?.entries ?? []; |