mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-28 07:43:55 +01:00
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.
This commit is contained in:
+17
@@ -258,3 +258,20 @@ jobs:
|
|||||||
})().catch(e => { console.error(e); process.exit(1); });
|
})().catch(e => { console.error(e); process.exit(1); });
|
||||||
ENDSCRIPT
|
ENDSCRIPT
|
||||||
shell: bash
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user