Skip to content

Commit ba5ddf9

Browse files
committed
ci: use git-auto-commit-action, upgrade Next.js to 16.1.6
- Use stefanzweifel/git-auto-commit-action@v7 for robust auto-commit - Add [skip ci] to auto-commit message to prevent loops - Upgrade Next.js from 16.0.7 to 16.1.6 - Simplify workflow conditions
1 parent be64ffc commit ba5ddf9

5 files changed

Lines changed: 68 additions & 82 deletions

File tree

.github/workflows/require_frontend_export.yml

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
jobs:
1717
require-frontend-export:
1818
runs-on: ubuntu-latest
19+
# Skip if the push was made by github-actions to avoid loops
1920
if: github.actor != 'github-actions[bot]'
2021
permissions:
2122
contents: write
@@ -42,6 +43,7 @@ jobs:
4243
# Handle initial push (no previous commit)
4344
if [[ "$base_sha" == "0000000000000000000000000000000000000000" ]]; then
4445
echo "Initial push - skipping check"
46+
echo "needs_export=false" >> "$GITHUB_OUTPUT"
4547
exit 0
4648
fi
4749
fi
@@ -74,47 +76,31 @@ jobs:
7476
} >> "$GITHUB_OUTPUT"
7577
7678
- name: Set up Node
77-
if: ${{ github.event_name == 'push' && steps.changes.outputs.needs_export == 'true' }}
79+
if: github.event_name == 'push' && steps.changes.outputs.needs_export == 'true'
7880
uses: actions/setup-node@v4
7981
with:
8082
node-version: 20
8183

8284
- name: Export frontend
83-
if: ${{ github.event_name == 'push' && steps.changes.outputs.needs_export == 'true' }}
84-
run: |
85-
bash scripts/export_frontend.sh
86-
87-
- name: Commit exported static assets
88-
if: ${{ github.event_name == 'push' && steps.changes.outputs.needs_export == 'true' }}
89-
run: |
90-
set -euo pipefail
85+
if: github.event_name == 'push' && steps.changes.outputs.needs_export == 'true'
86+
run: bash scripts/export_frontend.sh
9187

92-
if [[ -z "$(git status --porcelain)" ]]; then
93-
echo "No export changes to commit."
94-
exit 0
95-
fi
96-
97-
git status --short
98-
git config user.name "github-actions[bot]"
99-
git config user.email "github-actions[bot]@users.noreply.github.com"
100-
git add src/hyperview/server/static
101-
git commit -m "chore: export frontend static assets"
102-
git push
88+
- name: Commit and push exported static assets
89+
if: github.event_name == 'push' && steps.changes.outputs.needs_export == 'true'
90+
uses: stefanzweifel/git-auto-commit-action@v7
91+
with:
92+
commit_message: "chore: export frontend static assets [skip ci]"
93+
file_pattern: "src/hyperview/server/static/**"
10394

104-
- name: Verify static export updated when frontend changes
105-
if: ${{ !(github.event_name == 'push' && steps.changes.outputs.needs_export == 'true') }}
95+
- name: Fail PR if frontend changed without static export
96+
if: github.event_name == 'pull_request' && steps.changes.outputs.needs_export == 'true'
10697
run: |
107-
set -euo pipefail
108-
109-
frontend_changed="${{ steps.changes.outputs.frontend_changed }}"
110-
static_changed="${{ steps.changes.outputs.static_changed }}"
111-
112-
if [[ "$frontend_changed" == "true" && "$static_changed" != "true" ]]; then
113-
echo ""
114-
echo "ERROR: frontend/ changed but src/hyperview/server/static/ was not updated."
115-
echo "Run: bash scripts/export_frontend.sh"
116-
echo "Then commit the updated src/hyperview/server/static/ output."
117-
exit 1
118-
fi
119-
120-
echo "OK: export requirements satisfied."
98+
echo ""
99+
echo "ERROR: frontend/ changed but src/hyperview/server/static/ was not updated."
100+
echo ""
101+
echo "Run locally:"
102+
echo " bash scripts/export_frontend.sh"
103+
echo " git add src/hyperview/server/static"
104+
echo " git commit -m 'chore: export frontend static assets'"
105+
echo ""
106+
exit 1

frontend/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

frontend/package-lock.json

Lines changed: 43 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"hyper-scatter": "^0.1.0",
3030
"justified-layout": "^4.1.0",
3131
"lucide-react": "^0.562.0",
32-
"next": "^16.0.7",
32+
"next": "^16.1.6",
3333
"react": "18.3.1",
3434
"react-dom": "18.3.1",
3535
"tailwind-merge": "^3.4.0",
@@ -49,4 +49,3 @@
4949
"typescript": "^5.6.3"
5050
}
5151
}
52-

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ hyperview = "hyperview.cli:main"
5757
Homepage = "https://github.com/Hyper3Labs/HyperView"
5858
Documentation = "https://github.com/Hyper3Labs/HyperView#readme"
5959
Repository = "https://github.com/Hyper3Labs/HyperView"
60+
Issues = "https://github.com/Hyper3Labs/HyperView/issues"
6061

6162
[build-system]
6263
requires = ["hatchling"]

0 commit comments

Comments
 (0)