Skip to content

Commit

Permalink
fix: set status value to not required (#28)
Browse files Browse the repository at this point in the history
* fix: added check if the value is specified and the operation_mode is custom_field

* tests: added nil value status test
  • Loading branch information
leonsteinhaeuser committed Jan 27, 2022
1 parent 7704cf6 commit dd3b8a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ if [ -z "$ENTRYPOINT_MODE" ]; then
exit 1
fi
if [ -z "$ENTRYPOINT_TYPE" ]; then
echo "Parameter 1: ENTRYPOINT_TYPE is not set"
echo "Parameter 2: ENTRYPOINT_TYPE is not set"
exit 1
fi
if [ -z "$ORG_OR_USER_NAME" ]; then
echo "Parameter 1: ORG_OR_USER_NAME is not set"
echo "Parameter 3: ORG_OR_USER_NAME is not set"
exit 1
fi
if [ -z "$PROJECT_ID" ]; then
echo "Parameter 1: PROJECT_ID is not set"
echo "Parameter 4: PROJECT_ID is not set"
exit 1
fi
if [ -z "$RESOURCE_NODE_ID" ]; then
echo "Parameter 1: RESOURCE_NODE_ID is not set"
echo "Parameter 5: RESOURCE_NODE_ID is not set"
exit 1
fi
if [ -z "$RESOURCE_NODE_VALUE" ]; then
echo "Parameter 1: RESOURCE_NODE_VALUE is not set"
if [ "$ENTRYPOINT_TYPE" == "custom_field" ] && [ -z "$RESOURCE_NODE_VALUE" ]; then
echo "Parameter 6: ENTRYPOINT_TYPE=\"custom_field\" has beend specified but RESOURCE_NODE_VALUE is not set"
exit 1
fi

Expand Down
3 changes: 3 additions & 0 deletions test_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ENTRYPOINT_TYPE=status
RESOURCE_NODE_VALUE=Done
$ENTRYPOINT_SCRIPT "$ENTRYPOINT_MODE" "$ENTRYPOINT_TYPE" "$ORG_OR_USER_NAME" "$PROJECT_ID" "$RESOURCE_NODE_ID" "$RESOURCE_NODE_VALUE"

# change the status of a pr or issue to ''
$ENTRYPOINT_SCRIPT "$ENTRYPOINT_MODE" "$ENTRYPOINT_TYPE" "$ORG_OR_USER_NAME" "$PROJECT_ID" "$RESOURCE_NODE_ID"

# change the value of custom fields
date=$(date -d "+10 days" --rfc-3339=ns | sed 's/ /T/; s/\(\....\).*\([+-]\)/\1\2/g')
uuid1=$(uuidgen)
Expand Down

0 comments on commit dd3b8a3

Please sign in to comment.