From 24bc64e718a2e23b28961d356f1438e2697c00a4 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:09:14 +0100 Subject: [PATCH] Move a promoted script's telemetry history to ProxmoxVE When a merged PR came from a DevScripts migration, the telemetry service re-attributes that script's DevScripts records. Needs the TELEMETRY_ADMIN_TOKEN secret; without it the step is skipped. --- .github/workflows/close_issue_in_dev.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/close_issue_in_dev.yaml b/.github/workflows/close_issue_in_dev.yaml index 628da0e1f..99505c4c9 100644 --- a/.github/workflows/close_issue_in_dev.yaml +++ b/.github/workflows/close_issue_in_dev.yaml @@ -258,3 +258,20 @@ jobs: })().catch(e => { console.error(e); process.exit(1); }); ENDSCRIPT shell: bash + + - name: Move the scripts' telemetry to ProxmoxVE + if: ${{ !cancelled() && steps.find_issue.outputs.issue_numbers != '' && steps.get_slugs.outputs.count != '0' }} + shell: bash + env: + TELEMETRY_ADMIN_TOKEN: ${{ secrets.TELEMETRY_ADMIN_TOKEN }} + run: | + if [ -z "$TELEMETRY_ADMIN_TOKEN" ]; then + echo "TELEMETRY_ADMIN_TOKEN is not set, skipping" + exit 0 + fi + body=$(jq -cn --arg s "$(cat pocketbase_slugs.txt)" \ + '{slugs: ($s | split(" ") | map(select(. != ""))), from: "DevScripts", to: "ProxmoxVE"}') + curl -fsS -X POST "https://telemetry.community-scripts.org/api/admin/migrate-script" \ + -H "Authorization: Bearer ${TELEMETRY_ADMIN_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "$body" || echo "::warning::Moving the telemetry history to ProxmoxVE failed"