fix(deps): update all non-major dependencies #984
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: graphql commit schema | |
on: push | |
env: | |
node-version: 18 | |
mongodb-version: 6 | |
DATABASE_URL: mongodb://localhost:27017/test | |
jobs: | |
filter: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: read | |
outputs: | |
graphql: ${{ steps.changes.outputs.graphql }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.workflow_run.head_sha }} | |
- name: check for file changes | |
uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
token: ${{ github.token }} | |
filters: .github/filter.yaml | |
commit: | |
runs-on: ubuntu-latest | |
needs: filter | |
if: needs.filter.outputs.graphql == 'true' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.workflow_run.head_sha }} | |
token: ${{ secrets.PAT }} | |
- name: setup mongodb | |
uses: supercharge/mongodb-github-action@1.11.0 | |
with: | |
mongodb-version: ${{ env.mongodb-version }} | |
mongodb-port: 27017 | |
mongodb-db: test | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: "package.json" | |
- name: setup pnpm | |
uses: pnpm/action-setup@v2 | |
id: pnpm-install | |
with: | |
run_install: false | |
- name: setup pnpm environment variable | |
id: pnpm-env | |
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: cache pnpm dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-env.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: ${{ runner.os }}-pnpm-dependencies- | |
- name: install | |
run: pnpm install --frozen-lockfile | |
- name: setup prisma | |
run: pnpm turbo run generate --filter @usa/api | |
- name: generate graphql schema | |
run: seq 2 | timeout 30 xargs -P 2 -I {} sh .github/workflows/script/graphql-commit-schema.sh {} | |
continue-on-error: true | |
- name: commit | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
if git diff --name-only | grep -q "apps/website/graphql.schema.json"; then \ | |
git add ./apps/website/graphql.schema.json; \ | |
git commit -m "actions: 🤖 (graphql) updated graphql schema"; \ | |
git push origin HEAD:${GITHUB_REF} --force; \ | |
echo "Committed changes to GraphQL schema"; \ | |
else \ | |
echo "No changes detected in GraphQL schema"; \ | |
fi | |
graphql-commit-schema-check: | |
runs-on: ubuntu-latest | |
needs: commit | |
if: ${{ ! failure() }} | |
steps: | |
- name: check | |
run: echo "test is successfully executed." |