Skip to content

Commit 9a9286f

Browse files
committed
test changes for actor confirmation
1 parent 50de507 commit 9a9286f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/codeflash-optimize.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,18 @@ jobs:
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
@@ -49,4 +58,4 @@ jobs:
4958
id: optimize_code
5059
run: |
5160
source .venv/bin/activate
52-
poetry run codeflash
61+
poetry run codeflash

0 commit comments

Comments
 (0)