Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce5d26b

Browse files
authored
Merge pull requestactions#88 from clarkbw/patch-1
Add a GraphQL example to the README
2 parentseb58336 +91121b9 commitce5d26b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

‎README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,39 @@ jobs:
179179
console.log(result)
180180
```
181181

182+
### Run custom 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+
182215
_(Note that this particular example only works for a public URL, where the
183216
diff URL is publicly accessible. Getting the diff for a private URL requires
184217
using the API.)_

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp