Skip to content

Commit 64ea0a9

Browse files
authored
[CI] Do not run 'pre-commit' job on post commit (learning-process#500)
1 parent f220384 commit 64ea0a9

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

.github/workflows/ubuntu.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
jobs:
55
pre-commit:
66
runs-on: ubuntu-24.04
7+
if: github.event_name != 'push'
78
steps:
89
- uses: actions/checkout@v4
910
with:
@@ -17,14 +18,8 @@ jobs:
1718
python3 -m pip install -r requirements.txt
1819
- name: Run pre-commit checks
1920
run: |
20-
# For push events, compare with previous commit
21-
if [ "${{ github.event_name }}" = "push" ]; then
22-
pre-commit run --from-ref HEAD~1 --to-ref HEAD
23-
else
24-
# For PRs, compare with base branch
25-
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
26-
pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD
27-
fi
21+
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
22+
pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD
2823
gcc-build:
2924
needs:
3025
- pre-commit

0 commit comments

Comments
 (0)