Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/codeflash-optimize.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CodeFlash

on:
# Use pull_request_target for everything to ensure access to secrets
pull_request_target:
paths:
- '**' # Trigger for all paths
Expand All @@ -15,7 +14,14 @@ concurrency:
jobs:
optimize:
name: Optimize new Python code
environment: external-trusted-contributors
# Dynamically determine if environment is needed only when workflow files change and contributor is external
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' : ''
}}
if: ${{ github.actor != 'codeflash-ai[bot]' }}
runs-on: ubuntu-latest
env:
Expand All @@ -42,8 +48,8 @@ jobs:
# Allowlist check
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
echo "✅ Authorized user ($AUTHOR). Proceeding."
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
echo "✅ PR is open. Proceeding with appropriate protections."
else
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/end-to-end-test-bubblesort-pytest-no-git.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ on:

jobs:
bubble-sort-optimization-pytest-no-git:
environment: external-trusted-contributors
# Dynamically determine if environment is needed only when workflow files change and contributor is external
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': ''
}}
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand Down Expand Up @@ -39,7 +46,7 @@ jobs:
# Allowlist check
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
echo "✅ Authorized user ($AUTHOR). Proceeding."
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
else
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/end-to-end-test-bubblesort-unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ on:

jobs:
bubble-sort-optimization-unittest:
environment: external-trusted-contributors
# Dynamically determine if environment is needed only when workflow files change and contributor is external
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': ''
}}
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand Down Expand Up @@ -39,7 +46,7 @@ jobs:
# Allowlist check
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
echo "✅ Authorized user ($AUTHOR). Proceeding."
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
elif [["${{ github.event.pull_request.state }}" == "open" ]]; then
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
else
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/end-to-end-test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ on:

jobs:
end-to-end-test-coverage:
environment: external-trusted-contributors
# Dynamically determine if environment is needed only when workflow files change and contributor is external
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': ''
}}
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand All @@ -37,7 +44,7 @@ jobs:
# Allowlist check
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
echo "✅ Authorized user ($AUTHOR). Proceeding."
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
elif [["${{ github.event.pull_request.state }}" == "open" ]]; then
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
else
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/end-to-end-test-futurehouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ on:

jobs:
futurehouse-structure:
environment: external-trusted-contributors
# Dynamically determine if environment is needed only when workflow files change and contributor is external
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': ''
}}
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand Down Expand Up @@ -39,7 +46,7 @@ jobs:
# Allowlist check
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
echo "✅ Authorized user ($AUTHOR). Proceeding."
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
elif [["${{ github.event.pull_request.state }}" == "open" ]]; then
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
else
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/end-to-end-test-init-optim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ on:

jobs:
init-optimization:
environment: external-trusted-contributors
# Dynamically determine if environment is needed only when workflow files change and contributor is external
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': ''
}}
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand Down Expand Up @@ -38,7 +45,7 @@ jobs:
# Allowlist check
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
echo "✅ Authorized user ($AUTHOR). Proceeding."
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
elif [["${{ github.event.pull_request.state }}" == "open" ]]; then
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
else
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/end-to-end-test-tracer-replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ on:

jobs:
tracer-replay:
environment: external-trusted-contributors
# Dynamically determine if environment is needed only when workflow files change and contributor is external
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': ''
}}
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand Down Expand Up @@ -38,7 +45,7 @@ jobs:
# Allowlist check
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
echo "✅ Authorized user ($AUTHOR). Proceeding."
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
elif [["${{ github.event.pull_request.state }}" == "open" ]]; then
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
else
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/end-to-end-topological-sort-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ on:

jobs:
topological-sort-optimization:
environment: external-trusted-contributors
# Dynamically determine if environment is needed only when workflow files change and contributor is external
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': ''
}}
runs-on: ubuntu-latest
env:
CODEFLASH_AIS_SERVER: prod
Expand Down
Loading