Skip to content

Commit 0aca8ab

Browse files
authored
Add GitHub workflow to autoupdate pre-commit (#2542)
The PR replaces the previously implemented approach #2479 with adding `ci` section in `.pre-commit-config.yaml`, because it requires authentication at `pre-commit.ci` and adding the repo there.
1 parent 9c005a9 commit 0aca8ab

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Autoupdate pre-commit
2+
3+
on:
4+
# For Branch-Protection check. Only the default branch is supported. See
5+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
6+
branch_protection_rule:
7+
# To guarantee Maintained check is occasionally updated. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
9+
schedule:
10+
- cron: '28 2 * * 6' # Saturday at 02:28 UTC
11+
workflow_dispatch:
12+
13+
jobs:
14+
autoupdate:
15+
name: Autoupdate
16+
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
20+
steps:
21+
- name: Checkout DPNP repo
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
24+
- name: Set up python
25+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
26+
with:
27+
python-version: '3.13'
28+
29+
- name: Install pre-commit
30+
run: pip install pre-commit
31+
32+
- name: Run pre-commit autoupdate
33+
run: pre-commit autoupdate
34+
35+
- name: Create a PR with autoupdate changes
36+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e #v7.0.8
37+
with:
38+
commit-message: 'chore: update pre-commit hooks'
39+
add-paths: .pre-commit-config.yaml
40+
branch: 'bot/pre-commit-autoupdate'
41+
delete-branch: true
42+
title: Weekly pre-commit autoupdate
43+
body: |
44+
This PR updates the `.pre-commit-config.yaml` using `pre-commit autoupdate`.
45+
labels: autoupdate

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# See https://pre-commit.ci for more details
2-
ci:
3-
autofix_commit_msg: 'style: pre-commit fixes'
4-
autoupdate_commit_msg: 'chore: update pre-commit hooks'
5-
autoupdate_schedule: weekly
6-
71
# See https://pre-commit.com for more information
82
# See https://pre-commit.com/hooks.html for more hooks
93
repos:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131
* Replaced the use of `numpy.testing.suppress_warnings` with appropriate calls from the warnings module [#2529](https://github.com/IntelPython/dpnp/pull/2529)
3232
* Improved documentations of `dpnp.ndarray` class and added a page with description of supported constants [#2422](https://github.com/IntelPython/dpnp/pull/2422)
3333
* Updated `dpnp.size` to accept tuple of ints for `axes` argument [#2536](https://github.com/IntelPython/dpnp/pull/2536)
34+
* Replaced `ci` section in `.pre-commit-config.yaml` with a new GitHub workflow with scheduled run to autoupdate the `pre-commit` configuration [#2542](https://github.com/IntelPython/dpnp/pull/2542)
3435

3536
### Deprecated
3637

0 commit comments

Comments
 (0)