You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by ar...@apache.org on 2026/09/24 10:20:26 UTC

(tooling-actions) branch main updated: Send source_commit in a single jq object literal

This is an automated email from the ASF dual-hosted git repository.

alitheg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-actions.git


The following commit(s) were added to refs/heads/main by this push:
     new 8d914e7  Send source_commit in a single jq object literal
8d914e7 is described below

commit 8d914e7766413074b5bd30212d678537ed62078f
Author: Alastair McFarlane <al...@gmail.com>
AuthorDate: Thu Sep 24 11:19:45 2026 +0100

    Send source_commit in a single jq object literal
    
    ATR treats an empty source commit as not declared, so it doesn't need to be conditional. Keeping one object literal also lets the ATR contract tests parse the request body.
---
 upload-to-atr/action.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/upload-to-atr/action.yml b/upload-to-atr/action.yml
index 307734c..fd8ae4e 100644
--- a/upload-to-atr/action.yml
+++ b/upload-to-atr/action.yml
@@ -106,12 +106,12 @@ runs:
       shell: bash
       run: |
         set -euo pipefail
+        # ATR treats an empty source commit as not declared
         jq -n --arg publisher github \
               --arg jwt "$JWT" \
               --arg key "$SSH_PUBLIC_KEY" \
               --arg commit "$SOURCE_COMMIT" \
-              '{publisher:$publisher, jwt:$jwt, ssh_key:$key}
-                + (if $commit == "" then {} else {source_commit:$commit} end)' |
+              '{publisher:$publisher, jwt:$jwt, ssh_key:$key, source_commit:$commit}' |
           curl -sS --fail-with-body -X POST -H 'Content-Type: application/json' -d @- \
             "https://${INPUTS_ATR_HOST}/api/publisher/ssh/register"
       env:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org