diff --git a/.drone.yml b/.drone.yml index bf321a3..2725c70 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,7 +6,7 @@ name: Matrix Notifier check steps: - name: Pre-commit checks commands: - - nix flake check -vvv + - nix flake check - name: Notifiy commands: @@ -20,9 +20,6 @@ steps: from_secret: matrix_username PASS: from_secret: matrix_password - MESSAGE: - # FIXME: need to find a way to link - "Build ${DRONE_BUILD_STATUS} [${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}](${dummy_link}) (${DRONE_BRANCH}) by ${DRONE_COMMIT_AUTHOR}" settings: trigger: status: diff --git a/matrix-notifier b/matrix-notifier index 9bf6b4c..ebc2f67 100755 --- a/matrix-notifier +++ b/matrix-notifier @@ -23,6 +23,17 @@ rawurlencode() { echo "$encoded") } +default_drone_message() { + local msg="Build ${DRONE_BUILD_STATUS}" + msg="$msg ${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_BUILD_NUMBER}" + msg="$msg (${DRONE_BRANCH})" + printf '%s' "$msg" +} + +if [ "$DRONE" == "true" ] && [ -z "$MESSAGE" ]; then + MESSAGE="$(default_drone_message)" +fi + if [ -z "$USER" ] || [ -z "$PASS" ]; then print_err "You must provide USER and PASS" exit 1