Refactoring 20240909 video comments cfdxkk production(base) #20
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 |