When building a custom orb that uses slack-orb
, the orb-tools/pack
job fails with:
#!/bin/bash -eo pipefail #!/bin/bash # NOTE: an explicit API token is required for orb validation, for self-hosted CircleCI. # In the case of CircleCI cloud (https://circleci.com), an API token is not needed. ORB_DIR=${ORB_VAL_ORB_DIR%/} ORB_FILE=${ORB_VAL_ORB_FILE_NAME#/} if [ "https://circleci.com" != "${ORB_VAL_CIRCLECI_API_HOST}" ] && [ -z "${CIRCLE_TOKEN}" ]; then echo "Please set a valid CIRCLE_TOKEN token from your self-hosted CircleCI." exit 1 fi circleci orb validate --host "${ORB_VAL_CIRCLECI_API_HOST:-https://circleci.com}" --token "${CIRCLE_TOKEN:-dummy}" ${ORB_VAL_ORG_ID:+--org-id "$ORB_VAL_ORG_ID"} ${ORB_VAL_ORG_SLUG:+--org-slug "$ORB_VAL_ORG_SLUG"} --skip-update-check "${ORB_DIR}/${ORB_FILE}"
Error: Error calling command: ârelease_notify_slackâ
Error calling command: âslack/notifyâ
Type error for argument event: expected type: enum (âfailâ âpassâ âalwaysâ), actual value: âTEST_STRINGâ (type string)Exited with code exit status 255
CircleCI received exit code 255
release_notify_slack
is my custom command that uses slack/notify
.
Iâm using latest slack-orb
(4.12.5) and latest 2 major versions of orb-tools
(11.5, 12.0).
Honestly, this feels more like a bug in how circleci orb validate
handles enum parameters
TEST_STRING
seems to be coming from the circleci orb validate
run in app.circleci.com
.
I cannot reproduce locally with circleci org validate
, via brew (version 0.1.26837+b104265 (homebrew)
) or docker (image circleci/circleci-cli:0.1.26646
).
I found at least one third-party orb that actively works around this problem with enums via an unfortunate hack: github(dot)com/LedgerHQ/circleci-orbs/blob/ed2095079f737308d82fa8515cc2096865862af0/src/chef/orb.yml#L169-L170
Though they did this 3 years ago, so this doesnât seem to be a new thing?
Is there a better workaround known, or should I file an issue somewhere?