✨ 新增 API 接口 #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check for env theft | |
on: | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
check-process-env: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Fetch target branch | |
run: | | |
git fetch origin ${{ github.base_ref }} | |
- name: Search for process.env in code diff | |
run: | | |
# Check for changes in code (not just file names) | |
if git diff origin/${{ github.base_ref }} --unified=0 | grep -E "^\+.*process.env"; then | |
echo "Found process.env in changed code, check failed!" | |
exit 1 | |
else | |
echo "No process.env found in changed code, check passed!" | |
fi |