Skip to content

ci: add ci

ci: add ci #40

Workflow file for this run

name: Validate YAML
on:
pull_request:
branches: [main, dev]
types: [opened, synchronize, reopened, labeled]
push:
branches: [main, dev]
workflow_dispatch:
jobs:
validate-yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Read schema.yml and fetch file
id: fetch-file
run: |
sudo apt-get install -y jq
CONTENT=$(cat Fastbot/schema_dir.json)
CONFIG_PATH=$(echo "$CONTENT" | jq -r '.config.path')
CONFIG_BRANCH=$(echo "$CONTENT" | jq -r '.config.branch')
echo "Path: $CONFIG_PATH"
echo "Branch: $CONFIG_BRANCH"
JSON_FILE_URL="https://raw.githubusercontent.com/$CONFIG_PATH/$CONFIG_BRANCH/schema.json"
echo "URL del archivo schema.json: $JSON_FILE_URL"
curl -sS "$JSON_FILE_URL" > temp.json || { echo "Error al descargar schema.json"; exit 1; }
- uses: InoUno/yaml-ls-check@develop
with:
root: Fastbot/
schemaMapping: |
{
"${{ github.workspace }}/temp.json": [ "config.yml" ]
}