Skip to content

Commit

Permalink
add warning option for no connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwagoncomputing committed Aug 5, 2023
1 parent 691da72 commit ec2a714
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ inputs:
"notice" to warn on the Actions page,
or "error" to fail the workflow step.
default: "unset"
warning-no-connectors:
required: false
description: |
Set to "skip" to skip to the next mapping file,
"notice" to warn on the Actions page,
or "error" to fail the workflow step.
default: "unset"
warning-dupe:
required: false
description: |
Expand Down Expand Up @@ -69,6 +76,7 @@ runs:
WARNINGS: ${{ inputs.warnings }}
WARNING_NO_CID: ${{ inputs.warning-no-cid }}
WARNING_NO_IMAGE: ${{ inputs.warning-no-image }}
WARNING_NO_CONNECTORS: ${{ inputs.warning-no-connectors }}
WARNING_DUPE: ${{ inputs.warning-dupe }}
COLS: ${{ inputs.columns }}
PRINT_COLS: ${{ inputs.print-columns }}
Expand Down
5 changes: 4 additions & 1 deletion main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
# skip if "skip"
# env WARNING_NO_CID
# env WARNING_NO_IMAGE
# env WARNING_NO_CONNECTORS
# env WARNING_DUPE
# same options as WARNINGS

if [ "$DEBUG" = "true" ]; then
echo "WARNINGS: $WARNINGS"
echo "WARNING_NO_CID: $WARNING_NO_CID"
echo "WARNING_NO_IMAGE: $WARNING_NO_IMAGE"
echo "WARNING_NO_CONNECTORS: $WARNING_NO_CONNECTORS"
echo "WARNING_DUPE: $WARNING_DUPE"
fi

SCRIPTDIR=$(dirname "$0")
Expand Down Expand Up @@ -42,7 +45,7 @@ if [ "$DEBUG" = "true" ]; then
fi
if [ $(echo -n "$CONNECTORS" | wc -l) -eq 0 ]; then
echo "No connectors found"
handle_warning "$WARNING_NO_CONNECTORS" "WARNING: No connectors found"
exit
fi
Expand Down

0 comments on commit ec2a714

Please sign in to comment.