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
23 changes: 15 additions & 8 deletions .github/workflows/codeflash-optimize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,25 @@ jobs:
fetch-depth: 0
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check for any workflow changes
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
echo "⚠️ Workflow changes detected."
# Check if the PR author is allowed
# Get the PR author
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
echo "PR Author: $AUTHOR"
# 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."
else
echo "Authorized user ($AUTHOR). Proceeding."
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
fi
else
echo "✅ No workflow file changes detected. Proceeding."
fi
- name: 🐍 Set up Python 3.11 for CLI
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/end-to-end-test-bubblesort-pytest-no-git.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check for any workflow changes
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
echo "⚠️ Workflow changes detected."
# Check if the PR author is allowed
# Get the PR author
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
echo "PR Author: $AUTHOR"
# 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."
else
echo "Authorized user ($AUTHOR). Proceeding."
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
fi
else
echo "✅ No workflow file changes detected. Proceeding."
fi
- name: Set up Python 3.11 for CLI
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/end-to-end-test-bubblesort-unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check for any workflow changes
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
echo "⚠️ Workflow changes detected."

# Check if the PR author is allowed
# Get the PR author
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
echo "PR Author: $AUTHOR"

# 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."
else
echo "Authorized user ($AUTHOR). Proceeding."
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
fi
else
echo "✅ No workflow file changes detected. Proceeding."
fi

- name: Set up Python 3.11 for CLI
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/end-to-end-test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,25 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check for any workflow changes
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
echo "⚠️ Workflow changes detected."

# Check if the PR author is allowed
# Get the PR author
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
echo "PR Author: $AUTHOR"

# 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."
else
echo "Authorized user ($AUTHOR). Proceeding."
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
fi
else
echo "✅ No workflow file changes detected. Proceeding."
fi

- name: Set up Python 3.11 for CLI
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/end-to-end-test-futurehouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check for any workflow changes
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
echo "⚠️ Workflow changes detected."
# Check if the PR author is allowed
# Get the PR author
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
echo "PR Author: $AUTHOR"
# 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."
else
echo "Authorized user ($AUTHOR). Proceeding."
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
fi
else
echo "✅ No workflow file changes detected. Proceeding."
fi
- name: Set up Python 3.11 for CLI
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/end-to-end-test-init-optim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check for any workflow changes
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
echo "⚠️ Workflow changes detected."

# Check if the PR author is allowed
# Get the PR author
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
echo "PR Author: $AUTHOR"

# 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."
else
echo "Authorized user ($AUTHOR). Proceeding."
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
fi
else
echo "✅ No workflow file changes detected. Proceeding."
fi

- name: Set up Python 3.11 for CLI
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/end-to-end-test-tracer-replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check for any workflow changes
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
echo "⚠️ Workflow changes detected."

# Check if the PR author is allowed
# Get the PR author
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
echo "PR Author: $AUTHOR"

# 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."
else
echo "Authorized user ($AUTHOR). Proceeding."
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
fi
else
echo "✅ No workflow file changes detected. Proceeding."
fi


Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/end-to-end-topological-sort-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,26 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Validate PR
run: |
# Checking for any workflow changes for security risks
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
echo "Workflow changes detected."
# Check if the PR author is allowed
# Check for any workflow changes
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
echo "⚠️ Workflow changes detected."
# Get the PR author
AUTHOR="${{ github.event.pull_request.user.login }}"
if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
echo "PR Author: $AUTHOR"
# 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."
else
echo "Authorized user ($AUTHOR). Proceeding."
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
exit 1
fi
fiif git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-topological-sort-test.yaml"; then
echo "This workflow file has been modified. Exiting for security."
exit 1
else
echo "✅ No workflow file changes detected. Proceeding."
fi
- name: Set up Python 3.11 for CLI
Expand Down
Loading