File tree Expand file tree Collapse file tree 7 files changed +92
-26
lines changed Expand file tree Collapse file tree 7 files changed +92
-26
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,19 @@ jobs:
2323 token : ${{ secrets.GITHUB_TOKEN }}
2424 - name : Validate PR
2525 run : |
26- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-bubblesort-pytest-no-git.yaml"; then
27- echo "This workflow file has been modified. Exiting for security."
28- exit 1
29- fi
26+ # Checking for any workflow changes for security risks
27+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
28+ echo "Workflow changes detected."
29+
30+ # Check if the PR author is allowed
31+ AUTHOR="${{ github.event.pull_request.user.login }}"
32+ if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
33+ echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
34+ exit 1
35+ else
36+ echo "Authorized user ($AUTHOR). Proceeding."
37+ fi
38+ fi
3039
3140 - name : Set up Python 3.11 for CLI
3241 uses : astral-sh/setup-uv@v5
Original file line number Diff line number Diff line change 2323 token : ${{ secrets.GITHUB_TOKEN }}
2424 - name : Validate PR
2525 run : |
26- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-bubblesort-unittest.yaml"; then
27- echo "This workflow file has been modified. Exiting for security."
28- exit 1
26+ # Checking for any workflow changes for security risks
27+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
28+ echo "Workflow changes detected."
29+
30+ # Check if the PR author is allowed
31+ AUTHOR="${{ github.event.pull_request.user.login }}"
32+ if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
33+ echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
34+ exit 1
35+ else
36+ echo "Authorized user ($AUTHOR). Proceeding."
37+ fi
2938 fi
3039
3140 - name : Set up Python 3.11 for CLI
4453 id : optimize_code
4554 run : |
4655 source .venv/bin/activate
47- poetry run python tests/scripts/end_to_end_test_bubblesort_unittest.py
56+ poetry run python tests/scripts/end_to_end_test_bubblesort_unittest.py
Original file line number Diff line number Diff line change 2121 token : ${{ secrets.GITHUB_TOKEN }}
2222 - name : Validate PR
2323 run : |
24- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-coverage.yaml"; then
25- echo "This workflow file has been modified. Exiting for security."
26- exit 1
24+ # Checking for any workflow changes for security risks
25+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
26+ echo "Workflow changes detected."
27+
28+ # Check if the PR author is allowed
29+ AUTHOR="${{ github.event.pull_request.user.login }}"
30+ if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
31+ echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
32+ exit 1
33+ else
34+ echo "Authorized user ($AUTHOR). Proceeding."
35+ fi
2736 fi
2837
2938 - name : Set up Python 3.11 for CLI
4352 id : optimize_code
4453 run : |
4554 source .venv/bin/activate
46- poetry run python tests/scripts/end_to_end_test_coverage.py
55+ poetry run python tests/scripts/end_to_end_test_coverage.py
Original file line number Diff line number Diff line change 2323 token : ${{ secrets.GITHUB_TOKEN }}
2424 - name : Validate PR
2525 run : |
26- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-futurehouse.yaml"; then
27- echo "This workflow file has been modified. Exiting for security."
28- exit 1
26+ # Checking for any workflow changes for security risks
27+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
28+ echo "Workflow changes detected."
29+
30+ # Check if the PR author is allowed
31+ AUTHOR="${{ github.event.pull_request.user.login }}"
32+ if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
33+ echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
34+ exit 1
35+ else
36+ echo "Authorized user ($AUTHOR). Proceeding."
37+ fi
2938 fi
3039
3140 - name : Set up Python 3.11 for CLI
4453 id : optimize_code
4554 run : |
4655 source .venv/bin/activate
47- poetry run python tests/scripts/end_to_end_test_futurehouse.py
56+ poetry run python tests/scripts/end_to_end_test_futurehouse.py
Original file line number Diff line number Diff line change 2323 token : ${{ secrets.GITHUB_TOKEN }}
2424 - name : Validate PR
2525 run : |
26- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-init-optim.yaml"; then
27- echo "This workflow file has been modified. Exiting for security."
28- exit 1
26+ # Checking for any workflow changes for security risks
27+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
28+ echo "Workflow changes detected."
29+
30+ # Check if the PR author is allowed
31+ AUTHOR="${{ github.event.pull_request.user.login }}"
32+ if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
33+ echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
34+ exit 1
35+ else
36+ echo "Authorized user ($AUTHOR). Proceeding."
37+ fi
2938 fi
3039
3140 - name : Set up Python 3.11 for CLI
4453 id : optimize_code
4554 run : |
4655 source .venv/bin/activate
47- poetry run python tests/scripts/end_to_end_test_init_optimization.py
56+ poetry run python tests/scripts/end_to_end_test_init_optimization.py
Original file line number Diff line number Diff line change 2323 token : ${{ secrets.GITHUB_TOKEN }}
2424 - name : Validate PR
2525 run : |
26- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-tracer-replay.yaml"; then
27- echo "This workflow file has been modified. Exiting for security."
28- exit 1
26+ # Checking for any workflow changes for security risks
27+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
28+ echo "Workflow changes detected."
29+
30+ # Check if the PR author is allowed
31+ AUTHOR="${{ github.event.pull_request.user.login }}"
32+ if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
33+ echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
34+ exit 1
35+ else
36+ echo "Authorized user ($AUTHOR). Proceeding."
37+ fi
2938 fi
3039
3140
4554 id : optimize_code
4655 run : |
4756 source .venv/bin/activate
48- poetry run python tests/scripts/end_to_end_test_tracer_replay.py
57+ poetry run python tests/scripts/end_to_end_test_tracer_replay.py
Original file line number Diff line number Diff line change 2323 token : ${{ secrets.GITHUB_TOKEN }}
2424 - name : Validate PR
2525 run : |
26- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-topological-sort-test.yaml"; then
26+ # Checking for any workflow changes for security risks
27+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "^.github/workflows/"; then
28+ echo "Workflow changes detected."
29+
30+ # Check if the PR author is allowed
31+ AUTHOR="${{ github.event.pull_request.user.login }}"
32+ if [[ "$AUTHOR" != "misrasaurabh1" && "$AUTHOR" != "KRRT7" ]]; then
33+ echo "Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
34+ exit 1
35+ else
36+ echo "Authorized user ($AUTHOR). Proceeding."
37+ fi
38+ fiif git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-topological-sort-test.yaml"; then
2739 echo "This workflow file has been modified. Exiting for security."
2840 exit 1
2941 fi
4456 id : optimize_code
4557 run : |
4658 source .venv/bin/activate
47- poetry run python tests/scripts/end_to_end_test_topological_sort.py
59+ poetry run python tests/scripts/end_to_end_test_topological_sort.py
You can’t perform that action at this time.
0 commit comments