From e59a39cde58d4a1731d9f0e2687770715331bdc7 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 16 Jan 2026 08:36:50 +0100 Subject: [PATCH] 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. --- .github/workflows/get-versions-from-gh.yaml | 12 +----------- .github/workflows/scripts/get-gh-release.sh | 11 ++++++----- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/get-versions-from-gh.yaml b/.github/workflows/get-versions-from-gh.yaml index 0cf632d11..0a990efdd 100644 --- a/.github/workflows/get-versions-from-gh.yaml +++ b/.github/workflows/get-versions-from-gh.yaml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: community-scripts/ProxmoxVED ref: main @@ -70,13 +70,3 @@ jobs: if [ -n "$PR_NUMBER" ]; then gh pr review $PR_NUMBER --approve 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 diff --git a/.github/workflows/scripts/get-gh-release.sh b/.github/workflows/scripts/get-gh-release.sh index ddd966df4..55ae9d8a6 100644 --- a/.github/workflows/scripts/get-gh-release.sh +++ b/.github/workflows/scripts/get-gh-release.sh @@ -7,7 +7,7 @@ TMP_FILE="releases_tmp.json" if [ -f "$OUTPUT_FILE" ]; then cp "$OUTPUT_FILE" "$TMP_FILE" else - echo "[]" > "$TMP_FILE" + echo "[]" >"$TMP_FILE" fi while IFS= read -r repo; do @@ -26,14 +26,15 @@ while IFS= read -r repo; do if [[ "$existing_version" != "$tag" ]]; then 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" \ - '. += [{"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 echo "No change for $repo" fi -done < "$INPUT_FILE" +done <"$INPUT_FILE" -#mv "$TMP_FILE" "$OUTPUT_FILE" +mv "$TMP_FILE" "$OUTPUT_FILE" +echo "Updated $OUTPUT_FILE"