feat: run GitHub action to check json files freshness #4
Workflow file for this run
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: Are JSON files up to date | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check_codebase: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install pnpm | |
uses: pnpm/[email protected] | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: true | |
- name: Generate latest json schemas | |
run: | | |
pnpm generate | |
- name: Check for code changes | |
id: check_changes | |
run: | | |
git diff --exit-code || (echo "JSON schemas are stale."; exit 1) | |
- name: Final check and success | |
if: ${{ steps.check_changes.outcome == 'success' }} | |
run: echo "JSON schemas are up to date. Please run `pnpm generate` and commit the results." |