-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (53 loc) · 1.61 KB
/
auto-format.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: auto-format
on:
workflow_dispatch:
pull_request:
paths:
- "src/**"
- "README.qmd"
env:
GH_TOKEN: ${{ github.token }}
jobs:
auto-format:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install .[dev] --upgrade pip
- name: format
uses: psf/black@stable
with:
options: "--verbose"
use_pyproject: true
- name: commit & push
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "ci: 🤖 black formatting" && git push || echo "nothing to commit"
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.4.515
- name: quarto render readme
run: |
quarto render README.qmd
git add README.md
git commit -m "ci: 🤖 render readme" && git push || echo "nothing to commit"