Add syntax check workflow for bash, PHP, and YAML files
Some checks failed
Syntax Check / syntax-check (push) Failing after 54s
Some checks failed
Syntax Check / syntax-check (push) Failing after 54s
This commit is contained in:
44
.gitea/workflows/syntax-check.yml
Normal file
44
.gitea/workflows/syntax-check.yml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
name: Syntax Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
- dev
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
- dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
syntax-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install ShellCheck
|
||||||
|
run: apt-get update && apt-get install -y shellcheck
|
||||||
|
|
||||||
|
- name: Check bash script syntax
|
||||||
|
run: |
|
||||||
|
echo "Checking bash scripts..."
|
||||||
|
shellcheck git.sh
|
||||||
|
shellcheck example-trigger/deploy.sh
|
||||||
|
|
||||||
|
- name: Install PHP
|
||||||
|
run: apt-get install -y php-cli
|
||||||
|
|
||||||
|
- 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'))"
|
||||||
Reference in New Issue
Block a user