File tree 1 file changed +33
-0
lines changed
Filter options
1 file changed +33
-0
lines changed
Original file line number Diff line number Diff line change @@ -179,6 +179,39 @@ jobs:
179
179
console.log(result)
180
180
` ` `
181
181
182
+ # ## Run customer GraphQL queries
183
+
184
+ You can use the `github.graphql` object to run custom GraphQL queries against the GitHub API.
185
+
186
+ ` ` ` yaml
187
+
188
+ jobs:
189
+ list-packages:
190
+ runs-on: ubuntu-latest
191
+ steps:
192
+ - uses: actions/github-script@v3
193
+ with:
194
+ github-token: ${{secrets.GITHUB_TOKEN}}
195
+ script: |
196
+ const query = ` query($owner:String!, $name:String!) {
197
+ repository(owner:$owner, name:$name){
198
+ issues(first:100, labels : [$label]) {
199
+ nodes {
200
+ id
201
+ }
202
+ }
203
+ }
204
+ }`;
205
+ const variables = {
206
+ owner : context.repo.owner,
207
+ name : context.repo.repo,
208
+ label : ' wontfix'
209
+ }
210
+ const result = await github.graphql(query, variables)
211
+ console.log(result)
212
+
213
+ ```
214
+
182
215
_ (Note that this particular example only works for a public URL, where the
183
216
diff URL is publicly accessible. Getting the diff for a private URL requires
184
217
using the API.)_
You can’t perform that action at this time.
0 commit comments