Skip to content

Commit f688f74

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

7 files changed

+92
-26
lines changed

.github/workflows/end-to-end-test-bubblesort-pytest-no-git.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/end-to-end-test-bubblesort-unittest.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ 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-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
@@ -44,4 +53,4 @@ jobs:
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

.github/workflows/end-to-end-test-coverage.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ jobs:
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
@@ -43,4 +52,4 @@ jobs:
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

.github/workflows/end-to-end-test-futurehouse.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ 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-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
@@ -44,4 +53,4 @@ jobs:
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

.github/workflows/end-to-end-test-init-optim.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ 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-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
@@ -44,4 +53,4 @@ jobs:
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

.github/workflows/end-to-end-test-tracer-replay.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ 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-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
@@ -45,4 +54,4 @@ jobs:
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

.github/workflows/end-to-end-topological-sort-test.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +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-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
@@ -44,4 +56,4 @@ jobs:
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

0 commit comments

Comments
 (0)