File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 2828 fetch-depth : 0
2929 - name : Validate PR
3030 run : |
31- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "codeflash-optimize.yaml"; then
32- echo "This workflow file has been modified. Exiting for security."
33- exit 1
31+ # Checking for any workflow changes for security risks
32+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
33+ echo "Workflow changes detected."
34+
35+ # Check if the PR author is allowed
36+ AUTHOR="${{ github.event.pull_request.user.login }}"
37+ if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
38+ echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
39+ exit 1
40+ else
41+ echo "Authorized user ($AUTHOR). Proceeding."
42+ fi
3443 fi
3544
3645 - name : 🐍 Set up Python 3.11 for CLI
4958 id : optimize_code
5059 run : |
5160 source .venv/bin/activate
52- poetry run codeflash
61+ poetry run codeflash
You can’t perform that action at this time.
0 commit comments