From d8142344ac296bef790a2ec59ee2f748cf59df3e Mon Sep 17 00:00:00 2001 From: bdselynn Date: Wed, 11 Jun 2025 11:47:19 -0600 Subject: [PATCH] Update use-github-apis.yml --- .github/workflows/use-github-apis.yml | 31 +++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/use-github-apis.yml b/.github/workflows/use-github-apis.yml index 0b7d14c..f3f69a0 100644 --- a/.github/workflows/use-github-apis.yml +++ b/.github/workflows/use-github-apis.yml @@ -66,6 +66,33 @@ jobs: # Add here the labels query step + graphql-api-query-labels: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + id: labels-result + with: + script: | + const query = `query($owner:String!, $name:String!) { + repository(owner:$owner, name:$name){ + labels (last:100) { + nodes { + name, + color, + issues(last:100) { + nodes { + number + } + } + } + } + } + }`; + const variables = { + owner: context.repo.owner, + name: context.repo.repo + } + const result = await github.graphql(query, variables) + console.log(result.repository.labels.nodes) - - \ No newline at end of file +