Skip to content

Commit 4c4c132

Browse files
authored
add input for logging verbosity (#3)
Add the option to provide a logging verbosity to `chainctl` commands. Default is `0` (disabled). Signed-off-by: Colin Douglas <colin@chainguard.dev>
1 parent d7a3a1c commit 4c4c132

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

action.yaml

+11-4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ inputs:
3636
3737
Use of invite codes is DEPRECATED, use identity instead.
3838
required: false
39+
40+
verbosity:
41+
description: |
42+
Set the logging verbosity for chainctl. A value of 0 disables
43+
logging output. Valid values are 1-5, increasing in verbosity.
44+
required: false
45+
default: 0
3946

4047
runs:
4148
using: "composite"
@@ -57,13 +64,13 @@ runs:
5764
env:
5865
CHAINCTL_DEBUG: "true"
5966
run: |
60-
if chainctl auth login --identity "${{ inputs.identity }}"; then
67+
if chainctl auth login --identity "${{ inputs.identity }}" -v=${{ inputs.verbosity }}; then
6168
echo Logged in as ${{ inputs.identity }}!
6269
else
6370
echo Unable to assume the identity ${{ inputs.identity }}.
6471
exit 1
6572
fi
66-
if ! chainctl auth configure-docker --identity "${{ inputs.identity }}"; then
73+
if ! chainctl auth configure-docker --identity "${{ inputs.identity }}" -v=${{ inputs.verbosity }}; then
6774
echo Unable to register credential helper as ${{ inputs.identity }}.
6875
exit 1
6976
fi
@@ -84,7 +91,7 @@ runs:
8491
IDTOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=${AUDIENCE}" | jq -r '.value')
8592
8693
# This will start failing once the invite code expires, which is why we have the login guard.
87-
if chainctl auth login --create-group=false --identity-token "${IDTOKEN}" --invite-code="${CHAINGUARD_INVITE_CODE}"; then
94+
if chainctl auth login --create-group=false --identity-token "${IDTOKEN}" --invite-code="${CHAINGUARD_INVITE_CODE}" -v=${{ inputs.verbosity }}; then
8895
echo Logged in!
8996
else
9097
echo Failed to log in with invite code
@@ -106,7 +113,7 @@ runs:
106113
fi
107114
IDTOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=${AUDIENCE}" | jq -r '.value')
108115
109-
if chainctl auth login --identity-token "${IDTOKEN}"; then
116+
if chainctl auth login --identity-token "${IDTOKEN}" -v=${{ inputs.verbosity }}; then
110117
echo Logged in!
111118
else
112119
echo No invite code is present! Failing since registration will not do any good.

0 commit comments

Comments
 (0)