Merge pull request #6 from 2060-io/dev #41
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: 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" ] | |
} |