wpavatar/.forgejo/workflows/wp-plugin-ci.yml
wenpai 30509b169e
Some checks failed
gitleaks 密钥泄露扫描 / gitleaks (push) Successful in 1s
WordPress 插件 CI / ci (push) Failing after 1s
ci: deploy shared CI workflows from WenPai-org/ci-workflows
- gitleaks: secret leakage scanning
- wp-plugin-ci/go-ci: lint & static analysis
- security-scan: dependency vulnerability check
- auto-label: automatic PR labeling
- stale-cleanup: stale issue/PR management
2026-05-04 19:05:05 +08:00

41 lines
1.2 KiB
YAML

name: WordPress 插件 CI
on:
push:
branches: ['main', 'master']
pull_request:
branches: ['main', 'master']
jobs:
ci:
if: github.repository != 'WenPai-org/ci-workflows'
runs-on: linux-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: PHP Parallel Lint
run: |
parallel-lint --exclude vendor --exclude node_modules .
- name: PHPCS 代码规范检查
run: |
# 如果仓库有自定义 phpcs 配置则使用,否则用默认 WordPress 标准
if [ -f phpcs.xml ] || [ -f phpcs.xml.dist ] || [ -f .phpcs.xml ] || [ -f .phpcs.xml.dist ]; then
phpcs .
else
phpcs --standard=WordPress-Extra \
--extensions=php \
--ignore=vendor/*,node_modules/*,tests/*,lib/* \
--report=full \
-s .
fi
- name: Gitleaks 密钥泄露扫描
run: |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then
gitleaks detect --source=. --log-opts="$GITHUB_SHA~1..$GITHUB_SHA" --verbose --exit-code 1
else
gitleaks detect --source=. --verbose --exit-code 1
fi
echo "gitleaks 扫描通过"