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..." python3 -c "import yaml; yaml.safe_load(open('bitbucket-pipelines.yml'))" python3 -c "import yaml; yaml.safe_load(open('.gitea/workflows/syntax-check.yml'))"