k3s/scripts/dispatch
Rafael 5aca8e24b1
Some checks are pending
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Update dispatch script (#13079)
Signed-off-by: Rafael Breno <rafael_breno@outlook.com>
2025-10-21 16:25:58 -03:00

34 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
set -e
set -x
# The ref (branch or tag) to run the workflow on.
REF_TAG="$DRONE_TAG"
# --- k3s-io/k3s-upgrade ---
# API endpoint to target 'create-tag-on-dispatch.yml' directly
REPO_API_URL="https://api.github.com/repos/k3s-io/k3s-upgrade/actions/workflows/create-tag-on-dispatch.yml/dispatches"
# Send workflow_dispatch event
curl -L -XPOST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${PAT_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/json" \
"$REPO_API_URL" \
--data "{\"ref\":\"$REF_TAG\", \"inputs\": {\"tag\":\"$REF_TAG\"}}"
# --- rancher/system-agent-installer-k3s ---
# API endpoint to target 'create-tag-on-dispatch.yml' directly
SYSTEM_AGENT_API_URL="https://api.github.com/repos/rancher/system-agent-installer-k3s/actions/workflows/create-tag-on-dispatch.yml/dispatches"
# Send workflow_dispatch event
curl -L -XPOST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${K3S_RELEASE_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/json" \
"$SYSTEM_AGENT_API_URL" \
--data "{\"ref\":\"$REF_TAG\", \"inputs\": {\"tag\":\"$REF_TAG\"}}"