✨ 新增身份验证器 #24
Workflow file for this run
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 diff | |
run: | | |
if git diff --name-only --diff-filter=AM origin/${{ github.base_ref }} | xargs grep -E "process.env"; then | |
echo "Found process.env in changed files, check failed!" | |
exit 1 | |
else | |
echo "No process.env found in changed files, check passed!" | |
fi |