mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-27 14:55:45 +02:00
Add instant Incus sync trigger on ct/install changes
Fire a repository_dispatch (proxmoxve-scripts-changed) to community-scripts/Incus whenever a ct/ or install/ script changes on main, so the mirror tracks upstream within minutes instead of waiting for its daily cron. The mirroring + bootstrap rewrite stays in the Incus repo as the single source of truth. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A1R2A9UYwyL1FwcsADzSWU
This commit is contained in:
Generated
+49
@@ -0,0 +1,49 @@
|
||||
name: Sync ct/install to Incus
|
||||
|
||||
# When a ct/*.sh or install/*.sh file changes on main, trigger the Incus repo's
|
||||
# own sync workflow immediately instead of waiting for its daily 04:00 cron.
|
||||
#
|
||||
# The actual mirroring + transformation lives in community-scripts/Incus
|
||||
# (.github/workflows/sync-scripts.yml): it rewrites each script's bootstrap line
|
||||
# to load the engine from community-scripts/core (ProxmoxVE's misc/build.func is
|
||||
# a monolith with no Incus backend), so a plain 1:1 copy would break every Incus
|
||||
# script. We therefore only fire a repository_dispatch and let that single
|
||||
# source of truth do the work (and auto-approve + merge its own PR).
|
||||
#
|
||||
# Auth: secrets.PAT_AUTOMERGE (org secret, scope ALL) - the same dedicated-PAT
|
||||
# convention the Incus repo already uses to dispatch to core. It needs
|
||||
# contents:write on community-scripts/Incus.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "ct/**.sh"
|
||||
- "install/**.sh"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: sync-to-incus
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
if: github.repository == 'community-scripts/ProxmoxVE'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger Incus sync workflow
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PAT_AUTOMERGE }}
|
||||
SOURCE_SHA: ${{ github.sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "${GH_TOKEN:-}" ]; then
|
||||
echo "::error::PAT_AUTOMERGE is not available to this repo."
|
||||
exit 1
|
||||
fi
|
||||
echo "Dispatching proxmoxve-scripts-changed to community-scripts/Incus (from ${SOURCE_SHA})"
|
||||
gh api repos/community-scripts/Incus/dispatches \
|
||||
-X POST \
|
||||
-f "event_type=proxmoxve-scripts-changed" \
|
||||
-F "client_payload[sha]=${SOURCE_SHA}"
|
||||
Reference in New Issue
Block a user