Skip to content

Commit 00eb938

Browse files
committed
Add pre-commit on-schedule call
1 parent 91aad10 commit 00eb938

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
runs-on: ubuntu-latest
2121
if: >
2222
(github.event.pull_request.draft == false &&
23-
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
24-
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
23+
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
24+
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
2525
github.event_name == 'schedule'
2626
steps:
2727
- name: Get GitHub App token
@@ -65,6 +65,11 @@ jobs:
6565
exit 1
6666
env:
6767
HEAD_REF: ${{ github.event.pull_request.head.ref }}
68+
- id: pre_commit_schedule
69+
name: Run pre-commit in schedule
70+
if: github.event_name == 'schedule'
71+
run: |
72+
pre-commit run --all-files --show-diff-on-failure --color=always
6873
6974
test:
7075
strategy:
@@ -101,13 +106,14 @@ jobs:
101106

102107
examples:
103108
runs-on: ubuntu-latest
104-
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')
109+
if: (github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || github.event_name == 'schedule'
105110
steps:
106111
- uses: actions/checkout@v3
107112
- name: Install Python
108113
uses: actions/setup-python@v4
109114
with:
110115
python-version: "3.11"
116+
cache: "pip"
111117
- name: Upgrade pip
112118
run: |
113119
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)