More logging.

This commit is contained in:
2025-07-01 14:06:28 -07:00
parent 58768466b6
commit 9ffed504b7
2 changed files with 17 additions and 2 deletions

View File

@@ -34,6 +34,11 @@ runs:
- name: "Build route."
id: route
run: |
NAME="GitHub NuGet Query"
echo "::group::$NAME - Inputs"
echo "${{ toJSON(inputs) }}"
echo "::endgroup::"
# GitHub
#ROUTE="/_registry/nuget/${{ inputs.organization }}/query?"
# Gitea

View File

@@ -26,6 +26,11 @@ runs:
- name: "Build and run query."
id: query
run: |
NAME="GitHub Query"
echo "::group::$NAME - Inputs"
echo "${{ toJSON(inputs) }}"
echo "::endgroup::"
URL_ROOT="${{ inputs.url }}"
# Remove any trailing slash from the url root
URL_ROOT=${URL_ROOT%/}
@@ -41,14 +46,19 @@ runs:
if [[ -n "$TOKEN" ]]; then
QUERY="$QUERY -H \"Authorization: token $TOKEN\""
fi
OUTPUT=$(eval "$QUERY")
RESULT=$?
if [[ -n "$OUTPUT" ]]; then
echo "console<<EOF" >> "$GITHUB_OUTPUT"
echo "$OUTPUT" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
fi
echo "::group::$NAME - Outputs"
cat "$GITHUB_OUTPUT"
echo "::endgroup::"
exit $RESULT
shell: bash