name: Trigger Superpowers Sync on: push: branches: - thirdparty/skill workflow_dispatch: concurrency: group: superpowers-trigger-${{ github.repository }}-${{ github.ref }} cancel-in-progress: true jobs: trigger: name: Dispatch main workflow runs-on: ubuntu-22.04 steps: - name: Dispatch sync workflow on main shell: bash run: | set -euo pipefail TOKEN="${{ secrets.WORKFLOW }}" if [ -z "$TOKEN" ]; then echo "ERROR: WORKFLOW secret is required" >&2 exit 1 fi API_BASE="${GITHUB_API_URL:-${GITHUB_SERVER_URL}/api/v1}" WORKFLOW_FILE="sync-superpowers.yml" API="${API_BASE}/repos/${GITHUB_REPOSITORY}/actions/workflows/${WORKFLOW_FILE}/dispatches" curl -sSf -X POST \ -H "Authorization: token ${TOKEN}" \ -H "Content-Type: application/json" \ -d '{"ref":"main"}' \ "$API"