Use git clone for checkout, avoid GitHub dependency
Deploy / lint (push) Failing after 15s
Deploy / security (push) Failing after 15s
Deploy / deploy (push) Has been skipped

This commit is contained in:
Gan, Jimmy
2026-02-14 09:47:21 +08:00
parent 9c7d9493ff
commit 0a3e97161f
+13 -10
View File
@@ -7,36 +7,39 @@ jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout
run: |
git clone http://gitea:3000/jimmy/vps-oracle-jp.git .
git checkout ${{ github.sha }}
- name: Validate JSON - name: Validate JSON
run: python3 -c "import json; json.load(open('xray-config.json'))" run: python3 -c "import json; json.load(open('xray-config.json'))"
- name: Validate YAML - name: Validate YAML
run: python3 -c "import yaml; yaml.safe_load(open('clash-meta.yaml'))" run: pip install pyyaml -q && python3 -c "import yaml; yaml.safe_load(open('clash-meta.yaml'))"
security: security:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout
run: |
git clone http://gitea:3000/jimmy/vps-oracle-jp.git .
git checkout ${{ github.sha }}
- name: Check for secrets - name: Check for secrets
run: | run: |
FOUND=0 FOUND=0
# Check for private keys
if grep -rE '-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----' --include='*.json' --include='*.yaml' --include='*.yml' --include='*.md' .; then if grep -rE '-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----' --include='*.json' --include='*.yaml' --include='*.yml' --include='*.md' .; then
echo "ERROR: Private key found in repo" echo "ERROR: Private key found in repo"
FOUND=1 FOUND=1
fi fi
# Check for passwords/tokens in plain text
if grep -riE '(password|secret|token)\s*[:=]\s*["\x27]?[a-zA-Z0-9+/]{20,}' --include='*.json' --include='*.yaml' --include='*.yml' . | grep -v 'privateKey\|public-key'; then
echo "WARNING: Possible secret found"
FOUND=1
fi
exit $FOUND exit $FOUND
deploy: deploy:
needs: [lint, security] needs: [lint, security]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout
run: |
git clone http://gitea:3000/jimmy/vps-oracle-jp.git .
git checkout ${{ github.sha }}
- name: Deploy xray config - name: Deploy xray config
env: env:
VPS_SSH_KEY: ${{ secrets.VPS_SSH_KEY }} VPS_SSH_KEY: ${{ secrets.VPS_SSH_KEY }}