Skip to content

Feat/25 clean up workflow and schema #24

Feat/25 clean up workflow and schema

Feat/25 clean up workflow and schema #24

Workflow file for this run

name: validate_json
on:
workflow_call:
inputs:
should_download:
description: "Download JSON artifacts if called by another workflow?"
type: boolean
outputs:
is_valid:
description: "Is the JSON valid?"
value: ${{ jobs.validate.outputs.is_valid}}
pull_request:
branches: ["*"]
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
outputs:
is_valid: ${{ steps.save_state.outputs.is_valid}}
steps:
- uses: actions/checkout@v4
- name: Download JSON artifacts # if called by another workflow
if: ${{ inputs.should_download }}
uses: actions/download-artifact@v4
with:
name: json-files
path: json
- name: Verify JSON artifacts directory
if: ${{ inputs.should_download }}
run: |
echo "Current working directory: $(pwd)"
ls -la
ls -la json
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Validate JSON files
id: validate_json
run: check-jsonschema --schemafile ./schema.json json/notifications.json
- name: Save state
id: save_state
if: steps.validate_json.conclusion == 'success'
run: echo "is_valid=true" >> $GITHUB_OUTPUT