Skip to content

Commit adccee0

Browse files
author
auto-bot
committed
chore(ci): mirror upstream JSONs in release workflow and defer push
1 parent ec38ab9 commit adccee0

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

.github/workflows/publish_release.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,39 @@ jobs:
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

0 commit comments

Comments
 (0)