-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (67 loc) · 2.34 KB
/
main.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "master" ]
paths:
- '**.py'
- '**/**.py'
- '**.ipynb'
- '**/**.ipynb'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
OnCommit:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
cache-dependency-path: '**/requirements-ci.txt'
- run: pip install -r requirements-ci.txt
- name: Auto format
run: black . --exclude *unfinished*
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
committer_name: GitHub Actions
committer_email: actions@github.com
# author_name: Your Name
# author_email: mail@example.com
message: 'Autoformat'
add: "['*.py','*.ipynb']"
- name: Print SHAs
run: |
echo "github.event.pull_request.base.sha"
echo "${{ github.event.pull_request.base.sha }}"
echo "github.event.pull_request.head.sha"
echo "${{ github.event.pull_request.head.sha }}"
echo "github.event.before"
echo "${{ github.event.before }}"
echo "github.event.after"
echo "${{ github.event.after }}"
echo "github.sha"
echo "${{ github.sha }}"
- name: Convert to markdown
run: ./convert_to_markdown.sh ${{ github.event.before }} ${{ github.event.after }}
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
committer_name: GitHub Actions
committer_email: actions@github.com
# author_name: Your Name
# author_email: mail@example.com
message: 'CI - markdown conversion'
add: "*"
new_branch: markdown
tag_push: '--force'
push: 'origin markdown --set-upstream --force'