/asdf.sh Secret
Created
April 12, 2024 20:46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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