From ba750e28b73ad7c69bc05e01fb30f87fa539762e Mon Sep 17 00:00:00 2001 From: Johnatas Date: Fri, 6 Oct 2023 16:33:48 -0300 Subject: [PATCH] [v1.28] System agent push tags fix (#8568) * change script and drone Signed-off-by: Johnatas * adjust secret Signed-off-by: Johnatas --------- Signed-off-by: Johnatas --- .drone.yml | 3 +++ scripts/dispatch | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3cf71c7f3b7..bcfe2e19dc2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -673,12 +673,15 @@ steps: - name: dispatch image: curlimages/curl:7.74.0 + secrets: [ pat_username, github_token, release_token_k3s ] user: root environment: PAT_USERNAME: from_secret: pat_username PAT_TOKEN: from_secret: github_token + K3S_RELEASE_TOKEN: + from_secret: release_token_k3s commands: - apk -U --no-cache add bash - scripts/dispatch diff --git a/scripts/dispatch b/scripts/dispatch index ee320089f5a..d12e5c24831 100755 --- a/scripts/dispatch +++ b/scripts/dispatch @@ -13,7 +13,7 @@ curl -XPOST -u "${PAT_USERNAME}:${PAT_TOKEN}" \ SYSTEM_AGENT_INSTALLER_K3S_REPO="https://api.github.com/repos/rancher/system-agent-installer-k3s/dispatches" # send dispatch event to SYSTEM_AGENT_INSTALLER_K3S_REPO -curl -XPOST -u "${PAT_USERNAME}:${PAT_TOKEN}" \ +curl -XPOST -H "Authorization: Bearer ${K3S_RELEASE_TOKEN}" \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Content-Type: application/json" $SYSTEM_AGENT_INSTALLER_K3S_REPO \ + -H "Content-Type: application/vnd.github+json" $SYSTEM_AGENT_INSTALLER_K3S_REPO \ --data '{"event_type": "create_tag", "client_payload": {"tag":"'"$DRONE_TAG"'"}}'