Skip to content

Commit 548c40a

Browse files
Saga4KRRT7
authored andcommitted
fix workflow triggering condition (#136)
* fix workflow triggering condition * fix run
1 parent 6dee4eb commit 548c40a

9 files changed

+34
-6
lines changed

.github/workflows/codeflash-optimize.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: CodeFlash
22

33
on:
4+
# Use pull_request_target for everything to ensure access to secrets
45
pull_request_target:
56
paths:
6-
- "**"
7+
- '**' # Trigger for all paths
8+
79
workflow_dispatch:
810

911
concurrency:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: end-to-end-test
22

33
on:
4+
# Use pull_request_target for everything to ensure access to secrets
45
pull_request_target:
6+
paths:
7+
- '**' # Trigger for all paths
8+
59
workflow_dispatch:
610

711
jobs:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: end-to-end-test
22

33
on:
4+
# Use pull_request_target for everything to ensure access to secrets
45
pull_request_target:
6+
paths:
7+
- '**' # Trigger for all paths
8+
59
workflow_dispatch:
610

711
jobs:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: Coverage E2E
22

33
on:
4+
# Use pull_request_target for everything to ensure access to secrets
45
pull_request_target:
6+
paths:
7+
- '**' # Trigger for all paths
8+
59
workflow_dispatch:
610

711
jobs:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: end-to-end-test
22

33
on:
4+
# Use pull_request_target for everything to ensure access to secrets
45
pull_request_target:
6+
paths:
7+
- '**' # Trigger for all paths
8+
59
workflow_dispatch:
610

711
jobs:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: end-to-end-test
22

33
on:
4+
# Use pull_request_target for everything to ensure access to secrets
45
pull_request_target:
6+
paths:
7+
- '**' # Trigger for all paths
58
workflow_dispatch:
69

710
jobs:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: end-to-end-test
22

33
on:
4+
# Use pull_request_target for everything to ensure access to secrets
45
pull_request_target:
6+
paths:
7+
- '**' # Trigger for all paths
58
workflow_dispatch:
69

710
jobs:

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: end-to-end-test
22

33
on:
4+
# Use pull_request_target for everything to ensure access to secrets
45
pull_request_target:
6+
paths:
7+
- '**' # Trigger for all paths
8+
59
workflow_dispatch:
610

711
jobs:
@@ -23,7 +27,7 @@ jobs:
2327
fetch-depth: 0
2428
token: ${{ secrets.GITHUB_TOKEN }}
2529

26-
- name: Validate PR
30+
- name: Validate PR for workflow changes
2731
run: |
2832
# Check for any workflow changes
2933
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
@@ -34,8 +38,8 @@ jobs:
3438
# Allowlist check
3539
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
3640
echo "✅ Authorized user ($AUTHOR). Proceeding."
37-
elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
38-
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
41+
elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
42+
echo "✅ PR is open. Assuming protection rules are in place. Proceeding."
3943
else
4044
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
4145
exit 1

.github/workflows/label-workflow-changes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
owner: context.repo.owner,
2525
repo: context.repo.repo
2626
});
27-
27+
2828
const labelExists = labels.data.some(label => label.name === labelName);
29-
29+
3030
if (!labelExists) {
3131
// Create the label if it doesn't exist
3232
await github.rest.issues.createLabel({

0 commit comments

Comments
 (0)