File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 4545 git config user.name "github-actions[bot]"
4646 git config user.email "github-actions[bot]@users.noreply.github.com"
4747 git commit -m "chore: add VERSION $version" --allow-empty
48- git push --set-upstream origin "$branch"
48+
49+
50+ - name : Sync upstream JSONs
51+ env :
52+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53+ run : |
54+ set -euo pipefail
55+ tmp_dir=$(mktemp -d)
56+ api_url="https://api.github.com/repos/community-scripts/ProxmoxVE/contents/frontend/public/json"
57+ # Fetch file list (no subfolders)
58+ curl -sSL -H "Authorization: token $GH_TOKEN" "$api_url" \
59+ | jq -r '.[] | select(.type=="file") | .name' > "$tmp_dir/files.txt"
60+
61+ # Download each file
62+ while IFS= read -r name; do
63+ curl -sSL -H "Authorization: token $GH_TOKEN" \
64+ "https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/frontend/public/json/$name" \
65+ -o "$tmp_dir/$name"
66+ done < "$tmp_dir/files.txt"
67+
68+ mkdir -p json
69+ rsync -a --delete "$tmp_dir/" json/
70+
71+ # Stage and amend commit to include JSON updates (and VERSION)
72+ git add json VERSION
73+ if ! git diff --cached --quiet; then
74+ git commit --amend --no-edit
75+ fi
76+
77+
78+ - name : Push changes
79+ run : |
80+ git push --force-with-lease --set-upstream origin "update-version-${{ steps.draft.outputs.tag_name }}"
4981
5082
5183 - name : Create PR with GitHub CLI
You can’t perform that action at this time.
0 commit comments