Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asdf.sh Secret

Created April 12, 2024 20:40
Show Gist options
  • Select an option

  • Save KyMidd/2753303f50cd4d651627dc8afd0b1563 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/2753303f50cd4d651627dc8afd0b1563 to your computer and use it in GitHub Desktop.
# Filter for user's data block
user_data=$(echo "$copilot_all_user_data" | jq -r ".seats[] | select(.assignee.login==\"$copilot_user\")")
# Check if already cancellation set
pending_cancellation_date=$(echo "$user_data" | jq -r '.pending_cancellation_date')
# If cancellation date null, print hi
if [ "$pending_cancellation_date" == "null" ]; then
echo "No pending cancellation date"
else
echo "User is already scheduled for deactivation, skipping, user license will be disabled: $pending_cancellation_date"
continue
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment