Update workflow and script for improved release handling

Upgraded actions/checkout to v4 in the workflow and removed redundant re-approval step. Improved get-gh-release.sh by fixing whitespace, enabling output file update, and adding a completion message.
This commit is contained in:
CanbiZ 2026-01-16 08:36:50 +01:00
parent b511d4e30e
commit e59a39cde5
2 changed files with 7 additions and 16 deletions

View File

@ -17,7 +17,7 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
repository: community-scripts/ProxmoxVED repository: community-scripts/ProxmoxVED
ref: main ref: main
@ -70,13 +70,3 @@ jobs:
if [ -n "$PR_NUMBER" ]; then if [ -n "$PR_NUMBER" ]; then
gh pr review $PR_NUMBER --approve gh pr review $PR_NUMBER --approve
fi fi
- name: Re-approve pull request after update
if: env.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=$(gh pr list --head "update_versions" --json number --jq '.[].number')
if [ -n "$PR_NUMBER" ]; then
gh pr review $PR_NUMBER --approve
fi

View File

@ -7,7 +7,7 @@ TMP_FILE="releases_tmp.json"
if [ -f "$OUTPUT_FILE" ]; then if [ -f "$OUTPUT_FILE" ]; then
cp "$OUTPUT_FILE" "$TMP_FILE" cp "$OUTPUT_FILE" "$TMP_FILE"
else else
echo "[]" > "$TMP_FILE" echo "[]" >"$TMP_FILE"
fi fi
while IFS= read -r repo; do while IFS= read -r repo; do
@ -26,14 +26,15 @@ while IFS= read -r repo; do
if [[ "$existing_version" != "$tag" ]]; then if [[ "$existing_version" != "$tag" ]]; then
echo "New release for $repo: $tag" echo "New release for $repo: $tag"
jq --arg name "$repo" 'del(.[] | select(.name == $name))' "$TMP_FILE" > "$TMP_FILE.tmp" && mv "$TMP_FILE.tmp" "$TMP_FILE" jq --arg name "$repo" 'del(.[] | select(.name == $name))' "$TMP_FILE" >"$TMP_FILE.tmp" && mv "$TMP_FILE.tmp" "$TMP_FILE"
jq --arg name "$repo" --arg version "$tag" --arg date "$date" \ jq --arg name "$repo" --arg version "$tag" --arg date "$date" \
'. += [{"name": $name, "version": $version, "date": $date}]' "$TMP_FILE" > "$TMP_FILE.tmp" && mv "$TMP_FILE.tmp" "$TMP_FILE" '. += [{"name": $name, "version": $version, "date": $date}]' "$TMP_FILE" >"$TMP_FILE.tmp" && mv "$TMP_FILE.tmp" "$TMP_FILE"
else else
echo "No change for $repo" echo "No change for $repo"
fi fi
done < "$INPUT_FILE" done <"$INPUT_FILE"
#mv "$TMP_FILE" "$OUTPUT_FILE" mv "$TMP_FILE" "$OUTPUT_FILE"
echo "Updated $OUTPUT_FILE"