-
-
Save KyMidd/ef6d1c7da42884c91e9d67332453e5ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Convert the last active date to epoc | |
| # This uses branching logic because macs don't use GNUtils date | |
| if [ -z "$local_testing" ]; then | |
| last_active_date_in_epoc=$(date -d $last_active_date +"%s") | |
| else | |
| last_active_date_in_epoc=$(date -juf "%Y-%m-%dT%H:%M:%S" $last_active_date +%s 2>/dev/null) | |
| fi | |
| # Check if the last active date epoc is less than a month ago | |
| if (( $last_active_date_in_epoc < $date_one_month_ago )); then | |
| echo "🔴 User $copilot_user is inactive for more than a month, disabling copilot for user" | |
| remove_user_from_copilot | |
| continue | |
| else | |
| echo "🟢 User $copilot_user is active in the last month" | |
| fi | |
| done <<< "$copilot_all_users" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment