This is an automated email from the ASF dual-hosted git repository.
sbp 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 5418954 Make the upload to ATR action consistent
5418954 is described below
commit 54189544f94c2f7a4330545d06c7e96bf3d82a4b
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Sep 8 19:07:44 2025 +0100
Make the upload to ATR action consistent
---
upload-to-atr/action.yml | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/upload-to-atr/action.yml b/upload-to-atr/action.yml
index ca0d60e..15a9f64 100644
--- a/upload-to-atr/action.yml
+++ b/upload-to-atr/action.yml
@@ -37,8 +37,7 @@ runs:
run: |
set -euo pipefail
url="${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=atr-test-v1"
- jwt="$(curl -sS -H "Authorization: bearer
${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" "$url" \
- | python3 -c 'import json, sys;
print(json.load(sys.stdin)["value"])')"
+ jwt="$(curl -sS --fail-with-body -H "Authorization: bearer
${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" "$url" | jq -r .value)"
echo "::add-mask::$jwt"
echo "jwt=$jwt" >> "$GITHUB_OUTPUT"
@@ -55,12 +54,16 @@ runs:
shell: bash
run: |
set -euxo pipefail
+ case "${INPUTS_ATR_HOST}" in
+ *.apache.org) ;;
+ *) echo "atr-host must match *.apache.org"; exit 1;;
+ esac
jq -n --arg publisher github \
--arg jwt "$JWT" \
--arg key "$SSH_PUBLIC_KEY" \
'{publisher:$publisher, jwt:$jwt, ssh_key:$key}' |
- curl -sS -X POST -H 'Content-Type: application/json' \
- -d @- "https://${INPUTS_ATR_HOST}/api/publisher/ssh/register"
+ curl -sS --fail-with-body -X POST -H 'Content-Type:
application/json' -d @- \
+ "https://${INPUTS_ATR_HOST}/api/publisher/ssh/register"
env:
INPUTS_ATR_HOST: ${{ inputs.atr-host }}
JWT: ${{ steps.create-github-jwt.outputs.jwt }}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]