-
Notifications
You must be signed in to change notification settings - Fork 203
58 lines (48 loc) · 1.62 KB
/
auto-format-version.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: Formatting and Version Increment
on:
pull_request:
branches:
- master
env:
SOURCE_BRANCH: ${{ github.head_ref }}
BASE_BRANCH: ${{ github.base_ref }}
jobs:
code-formatting_increment-version:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -r requirements_test.txt
- name: Run version increment script
id: version_increment
run: |
python scripts/update_version.py ${{ env.BASE_BRANCH }} ${{ env.SOURCE_BRANCH }}
bash scripts/auto_commit.sh "Automated version changes"
continue-on-error: true
- name: Updating README files
id: update_readme
run: |
bash scripts/update_readme.sh
bash scripts/auto_commit.sh "Updating README files"
continue-on-error: true
- name: Code formatting and committing changes
id: code_format
run: |
bash scripts/auto_format.sh
bash scripts/auto_commit.sh "Automated formatting changes"
continue-on-error: true
- name: Push changes to source branch
id: push_to_source_branch
if: ${{ steps.version_increment.outcome == 'success' || steps.update_readme.outcome == 'success' || steps.code_format.outcome == 'success' }}
uses: ad-m/github-push-action@master
with:
branch: ${{ env.SOURCE_BRANCH }}