12
12
PYTHON_VERSION : " 3.12"
13
13
14
14
jobs :
15
- check- update :
15
+ update-static-files :
16
16
runs-on : ubuntu-latest
17
17
steps :
18
18
- uses : actions/checkout@v4
@@ -33,27 +33,10 @@ jobs:
33
33
34
34
- name : Check for changes
35
35
id : changed-files
36
- run : git diff --exit-code || echo "has_changes=true" >> $GITHUB_OUTPUT
37
-
38
- outputs :
39
- has_changes : ${{ steps.changed-files.outputs.has_changes }}
40
-
41
- update-files :
42
- runs-on : ubuntu-latest
43
- needs : [check-update]
44
- if : needs.check-update.outputs.has_changes == 'true'
45
- steps :
46
- - uses : actions/checkout@v4
47
-
48
- - name : Set up Python ${{ matrix.config.python-version }}
49
- uses : actions/setup-python@v5
50
- with :
51
- python-version : ${{ matrix.config.python-version }}
52
-
53
- - name : Install Hatch
54
- run : pip install hatch
36
+ run : echo "static_files_changed=$(git diff --quiet || echo true)" >> $GITHUB_OUTPUT
55
37
56
38
- name : Create and push changes
39
+ if : steps.changed-files.outputs.static_files_changed
57
40
run : |
58
41
git config user.email "[email protected] "
59
42
git config user.name "Vizro Team"
@@ -64,12 +47,10 @@ jobs:
64
47
git push origin --delete bot/update-static-files || true
65
48
git push --set-upstream origin bot/update-static-files
66
49
67
- - name : Install GitHub CLI
68
- run : sudo apt-get install -y gh
69
-
70
50
- name : Create Pull Request
51
+ if : steps.changed-files.outputs.static_files_changed
71
52
run : |
53
+ sudo apt-get install -y gh
72
54
gh pr create -B main -H bot/update-static-files --title "[Bot] Update static files" --body "Automated update of static files"
73
-
74
55
env :
75
56
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments