Skip to content

Commit 0e3e758

Browse files
committed
restore workflow dispatch
1 parent 7d517b9 commit 0e3e758

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/format_check.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,24 @@ on:
1414
branches:
1515
- 'main'
1616

17+
workflow_dispatch:
18+
1719
jobs:
1820
verify-format:
1921
runs-on: ubuntu-latest
2022
steps:
23+
2124
- name: Checkout code
2225
uses: actions/checkout@v4
2326
with:
2427
submodules: false
2528
persist-credentials: false
29+
30+
- name: Get first commit SHA
31+
id: first-commit
32+
if: github.event_name == 'workflow_dispatch'
33+
run: echo "sha=$(git rev-list --max-parents=0 HEAD)" >> $GITHUB_OUTPUT
34+
2635
- name: Get changed source files that need format check
2736
id: changed-files
2837
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
@@ -38,9 +47,12 @@ jobs:
3847
libraries/extras/**
3948
libraries/ea_malloc/**
4049
write_output_files: true
50+
base_sha: ${{ steps.first-commit.outputs.sha if github.event_name == 'workflow_dispatch' else '' }}
51+
4152
- name: List changed files
4253
if: steps.changed-files.outputs.any_changed == 'true'
4354
run: cat .github/outputs/all_changed_files.txt
55+
4456
- name: Run clang-format check
4557
if: steps.changed-files.outputs.any_changed == 'true'
4658
uses: pillo79/clang-format-action@05f671e71f0758aba4d3c9dbb0ee81bc5f0137c6

0 commit comments

Comments
 (0)