Skip to content

Update SDK queries

Update SDK queries #8

on:
workflow_dispatch:
name: Update SDK queries
jobs:
updateQueries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: graphql-queries
repository: fragment-dev/graphql-queries
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@v4
name: Checkout node-client
with:
path: node-client
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.PR_APP_ID }}
private_key: ${{ secrets.PR_APP_PRIVATE_KEY }}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-check-release-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-check-release
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install dependencies
working-directory: ./node-client
run: yarn
- name: Copy queries.graphql
working-directory: ./node-client
run: |
cp ../graphql-queries/queries.graphql src/queries/queries.graphql
- name: Build
working-directory: ./node-client
run: yarn build
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
path: ./node-client
token: ${{ steps.generate-token.outputs.token }}
commit-message: 'Update Node SDK queries'
title: 'Update Node SDK queries'
base: 'dev'
branch: update-sdk-queries/${{ github.run_id }}
body: >
This PR is auto-generated by github action.