Skip to content

Commit c1afc8f

Browse files
committed
Add workflow_dispatch trigger to pr-check for manual runs
1 parent f147b82 commit c1afc8f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/pr-check.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ on:
66
paths:
77
- "data/tools/**.yml"
88
- "ci/**"
9+
workflow_dispatch:
10+
inputs:
11+
pr_number:
12+
description: "PR number to check"
13+
required: true
14+
tool_files:
15+
description: "Space-separated list of tool YAML files to check (e.g. data/tools/foo.yml)"
16+
required: true
917

1018
jobs:
1119
pr-check:
@@ -21,7 +29,11 @@ jobs:
2129
- name: Get changed tool files
2230
id: changed
2331
run: |
24-
FILES=$(git diff --name-only --diff-filter=A origin/master...HEAD -- 'data/tools/*.yml' | tr '\n' ' ')
32+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
33+
FILES="${{ inputs.tool_files }}"
34+
else
35+
FILES=$(git diff --name-only --diff-filter=A origin/master...HEAD -- 'data/tools/*.yml' | tr '\n' ' ')
36+
fi
2537
echo "files=$FILES" >> "$GITHUB_OUTPUT"
2638
2739
- name: Install Rust toolchain
@@ -45,6 +57,6 @@ jobs:
4557
env:
4658
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4759
GITHUB_REPOSITORY: ${{ github.repository }}
48-
PR_NUMBER: ${{ github.event.pull_request.number }}
60+
PR_NUMBER: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || github.event.pull_request.number }}
4961
run: |
5062
ci/target/release/pr-check ${{ steps.changed.outputs.files }}

0 commit comments

Comments
 (0)