Skip to content

Commit ff31811

Browse files
[CI] Fix update static files GHA (#1036)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 513a764 commit ff31811

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

.github/workflows/update-static-files.yml

+5-24
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
PYTHON_VERSION: "3.12"
1313

1414
jobs:
15-
check-update:
15+
update-static-files:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
@@ -33,27 +33,10 @@ jobs:
3333

3434
- name: Check for changes
3535
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
5537

5638
- name: Create and push changes
39+
if: steps.changed-files.outputs.static_files_changed
5740
run: |
5841
git config user.email "[email protected]"
5942
git config user.name "Vizro Team"
@@ -64,12 +47,10 @@ jobs:
6447
git push origin --delete bot/update-static-files || true
6548
git push --set-upstream origin bot/update-static-files
6649
67-
- name: Install GitHub CLI
68-
run: sudo apt-get install -y gh
69-
7050
- name: Create Pull Request
51+
if: steps.changed-files.outputs.static_files_changed
7152
run: |
53+
sudo apt-get install -y gh
7254
gh pr create -B main -H bot/update-static-files --title "[Bot] Update static files" --body "Automated update of static files"
73-
7455
env:
7556
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)