chore: add ci for generating + publishing schema.json #3
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: "Generate Schema" | |
on: | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: write | |
pull-requests: write | |
env: | |
DENO_DIR: ~/.deno-cache | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
deno-version: [1.41.3] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Setup Deno ${{ matrix.deno-version }} | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: ${{ matrix.deno-version }} | |
- name: Run generate-schema | |
run: deno task generate-schema | |
- name: Commit and push to pr | |
run: | | |
diff=$(git diff schema.json) | |
if [[ "${diff}" ]]; then | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add schema.json | |
git commit -m 'chore(schema): generate' | |
git push | |
exit 0 | |
fi | |
echo "skipping" |