Skip to content

Commit 1a4d5b4

Browse files
authored
Merge branch 'main' into cf-621
2 parents 3ff6eff + 32f2908 commit 1a4d5b4

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

.github/workflows/codeflash-optimize.yaml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CodeFlash
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
paths:
66
- '**' # Trigger for all paths
77

@@ -14,8 +14,6 @@ concurrency:
1414
jobs:
1515
optimize:
1616
name: Optimize new Python code
17-
# Dynamically determine if environment is needed only when workflow files change and contributor is external
18-
environment: ${{ (github.event_name == 'workflow_dispatch' || (contains(toJSON(github.event.pull_request.files.*.filename), '.github/workflows/') && github.event.pull_request.user.login != 'misrasaurabh1' && github.event.pull_request.user.login != 'KRRT7')) && 'external-trusted-contributors' || '' }}
1917
if: ${{ github.actor != 'codeflash-ai[bot]' }}
2018
runs-on: ubuntu-latest
2119
env:
@@ -28,31 +26,7 @@ jobs:
2826
- name: 🛎️ Checkout
2927
uses: actions/checkout@v4
3028
with:
31-
ref: ${{ github.event.pull_request.head.ref }}
32-
repository: ${{ github.event.pull_request.head.repo.full_name }}
3329
fetch-depth: 0
34-
- name: Validate PR
35-
run: |
36-
# Check for any workflow changes
37-
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" | grep -q "^.github/workflows/"; then
38-
echo "⚠️ Workflow changes detected."
39-
40-
# Get the PR author
41-
AUTHOR="${{ github.event.pull_request.user.login }}"
42-
echo "PR Author: $AUTHOR"
43-
44-
# Allowlist check
45-
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
46-
echo "✅ Authorized user ($AUTHOR). Proceeding."
47-
elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
48-
echo "✅ PR is open. Proceeding with appropriate protections."
49-
else
50-
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
51-
exit 1
52-
fi
53-
else
54-
echo "✅ No workflow file changes detected. Proceeding."
55-
fi
5630

5731
- name: 🐍 Set up Python 3.11 for CLI
5832
uses: astral-sh/setup-uv@v5

0 commit comments

Comments
 (0)