-
Notifications
You must be signed in to change notification settings - Fork 652
41 lines (37 loc) · 1.14 KB
/
pre-commit-autoupdate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: pre-commit-autoupdate
on:
workflow_dispatch:
schedule:
- cron: '42 15 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
pull-requests: write
jobs:
pre-commit-autoupdate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
ref: dev
# https://github.com/peter-evans/create-pull-request/issues/48
token: ${{ secrets.GH_PAT }}
- uses: actions/setup-python@v4
with:
# https://github.com/actions/python-versions/releases
python-version: '3.11'
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout -b pre-commit-autoupdate
pip install pre-commit
pre-commit --version
pre-commit autoupdate
git diff --exit-code && exit 0
git add -A
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit -m '[CI/CD] pre-commit autoupdate'
git push -f origin pre-commit-autoupdate
gh pr create -B dev -H pre-commit-autoupdate -f -l 'CI/CD'