在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):helaili/github-graphql-action开源软件地址(OpenSource Url):https://github.com/helaili/github-graphql-action开源编程语言(OpenSource Language):JavaScript 90.0%开源软件介绍(OpenSource Introduction):github-graphql-actionAn action that acts a client for GitHub's GraphQL API and can be chained. It means you can use a first instance to execute a GraphQL query and use its output to execute a GraphQL mutation. Check a sample workflow and sample GraphqQL queries Input parameters
Output parameter
Query fileThe query file contains the GraphQL query or mutation to execute. Format is YAML based. Static parametersquery: '
query($owner:String!, $name:String!) {
repository(owner:$owner, name:$name) {
name
}
}'
variables:
owner: helaili
name: github-graphql-action ...
jobs:
static-query:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
query: samples/repository-static.query.yaml Parameters defined in the worklowVariables values can also come from extra input parameters. query: '
query($owner:String!, $name:String!) {
repository(owner:$owner, name:$name) {
name
}
}'
variables:
owner:
type: arg
name: owner
name:
type: arg
name: name ...
jobs:
args-query:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
query: samples/repository-args.query.yaml
owner: helaili
name: github-graphql-action File based parametersVariable values can also come from a file, typically You can optionally add a query:'
query($owner:String!, $name:String!) {
repository(owner:$owner, name:$name) {
name
}
}'
variables:
owner:
type: jq
file: ../workflow/event.json
query: '.repository.owner.login'
name:
type: jq
file: ../workflow/event.json
query: '.repository.name' ...
jobs:
introspection-query:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
query: samples/introspection.query.yaml
logLevel: debug
accept: application/vnd.github.elektra-preview+json Mutationquery: '
mutation pinIssue($issueId: ID!){
pinIssue(input: { issueId: $issueId }) {
issue {
repository {
id
}
}
}
}'
variables:
issueId:
type: jq
file: ../workflow/event.json
query: '.issue.node_id' |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论