Skip to content

Commit 3da54c7

Browse files
committed
Add GitHub workflow to autoupdate pre-commit
1 parent 8ca6731 commit 3da54c7

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-FileCopyrightText: 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Autoupdate pre-commit
6+
7+
on:
8+
# To be able to be triggered manually
9+
workflow_dispatch:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '28 2 * * 6' # Saturday at 02:28 UTC
14+
15+
permissions: read-all
16+
17+
jobs:
18+
autoupdate:
19+
name: Autoupdate
20+
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 10
23+
24+
permissions:
25+
# Needed to create a PR with autoupdate changes
26+
contents: write
27+
pull-requests: write
28+
29+
steps:
30+
- name: Checkout DPNP repo
31+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32+
33+
- name: Set up python
34+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
35+
with:
36+
python-version: '3.13'
37+
38+
- name: Install pre-commit
39+
run: pip install pre-commit
40+
41+
- name: Run pre-commit autoupdate
42+
run: pre-commit autoupdate
43+
44+
- name: Create a PR with autoupdate changes
45+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e #v7.0.8
46+
with:
47+
commit-message: 'chore: update pre-commit hooks'
48+
add-paths: .pre-commit-config.yaml
49+
branch: 'bot/pre-commit-autoupdate'
50+
delete-branch: true
51+
title: Weekly pre-commit autoupdate
52+
body: |
53+
This PR updates the `.pre-commit-config.yaml` using `pre-commit autoupdate`.
54+
labels: autoupdate

0 commit comments

Comments
 (0)