Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asdf.sh Secret

Created April 12, 2024 20:46
# Get the last editor of the user
last_editor=$(echo "$user_data" | jq -r '.last_activity_editor')
echo "Last editor: $last_editor"
# Get the last active date of the user
last_active_date=$(echo "$user_data" | jq -r '.last_activity_at')
echo "Last activity date at: $last_active_date"
# Check if last_active_date is null
if [ "$last_active_date" == "null" ]; then
echo "🔴 User $copilot_user has never been active"
# If created date more than a month ago, then user is inactive
if (( $created_date_in_epoc < $date_one_month_ago )); then
echo "🔴 User $copilot_user is inactive and was created more than a month ago, disabling user"
remove_user_from_copilot
else
echo "🟢 User $copilot_user is not active yet, but was created in the last month. Leaving active."
fi
continue
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment