From 64f73f3edbf46bf20c4c2e005a334c90177c3c45 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Mon, 26 Feb 2024 11:59:40 +0100 Subject: [PATCH] Ensure gh token is retrieved before submission steps (#1581) --- src/alire/alire-publish-submit.adb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/alire/alire-publish-submit.adb b/src/alire/alire-publish-submit.adb index 4cd25ad6..27cae24a 100644 --- a/src/alire/alire-publish-submit.adb +++ b/src/alire/alire-publish-submit.adb @@ -166,11 +166,20 @@ package body Alire.Publish.Submit is --------------- procedure Fork (Context : in out Data) is + use type UString; begin if not Ask_To_Fork (Context) then Raise_Checked_Error ("Cannot continue with automatic submission"); end if; + + -- If the fork already existed, the token wouldn't have been needed up + -- to this point, so now we make sure it is informed for next steps. + + if Context.Token = "" then + Context.Token := +Ask_For_Token + ("to create a submission to the community index on your behalf"); + end if; end Fork; ----------- -- 2.39.5