From 0f10fbab705ebc08570acd3b171831356fc60c18 Mon Sep 17 00:00:00 2001 From: "Alejandro R. Mosteo" Date: Fri, 23 Feb 2024 18:38:13 +0100 Subject: [PATCH] Ensure gh token is retrieved before submission steps --- 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 4cd25ad6d..27cae24a8 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; -----------