Files
git-incron-deploy/.gitea/workflows/syntax-check.yml
Atlas 9af565c700
All checks were successful
Syntax Check / syntax-check (push) Successful in 6s
fix: install python yaml module for YAML validation
2026-02-11 05:20:52 +00:00

62 lines
1.8 KiB
YAML

name: Syntax Check
on:
push:
branches:
- main
- master
- dev
pull_request:
branches:
- main
- master
- dev
jobs:
syntax-check:
runs-on: linux,x86_64,docker
steps:
- name: Checkout code
run: |
git clone --depth 1 "$(echo "${{ gitea.server_url }}" | sed "s|://|://oauth2:${{ gitea.token }}@|")/${{ gitea.repository }}.git" .
git checkout -q ${{ github.sha }}
- name: Install ShellCheck
run: |
if command -v apk >/dev/null 2>&1; then
apk add --no-cache shellcheck
elif command -v apt-get >/dev/null 2>&1; then
apt-get update && apt-get install -y shellcheck
fi
- name: Check bash script syntax
run: |
echo "Checking bash scripts..."
shellcheck git.sh
shellcheck example-trigger/deploy.sh
- name: Install PHP
run: |
if command -v apk >/dev/null 2>&1; then
apk add --no-cache php
elif command -v apt-get >/dev/null 2>&1; then
apt-get install -y php-cli
fi
- name: Check PHP syntax
run: |
echo "Checking PHP scripts..."
php -l example-trigger/deploy.php
- name: Validate YAML configuration
run: |
echo "Checking YAML files..."
if command -v apk >/dev/null 2>&1; then
apk add --no-cache py3-yaml
elif command -v apt-get >/dev/null 2>&1; then
apt-get update && apt-get install -y python3-yaml
fi
python3 -c "import yaml; yaml.safe_load(open('bitbucket-pipelines.yml'))"
python3 -c "import yaml; yaml.safe_load(open('.gitea/workflows/syntax-check.yml'))"