@@ -72,6 +72,17 @@ if [ -e "${provisioning_profile_path}" ]; then
72
72
profile_expire_date=$( security cms -D -i " ${provisioning_profile_path} " | plutil -p - | grep ExpirationDate | cut -b 23-)
73
73
# Convert to plutil format
74
74
profile_expire_date=$( date -j -f " %Y-%m-%d %H:%M:%S" " ${profile_expire_date} " +" %Y-%m-%dT%H:%M:%SZ" )
75
+ # Handle github action, testflight builds that expire <= 90 days
76
+ if [ -n " $GITHUB_ACTIONS " ]; then
77
+ github_expire_date=$( date -j -v+90d +" %Y-%m-%dT%H:%M:%SZ" )
78
+
79
+ if [ " $( date -j -f " %Y-%m-%dT%H:%M:%SZ" " ${github_expire_date} " +%s) " -lt " $( date -j -f " %Y-%m-%dT%H:%M:%SZ" " ${profile_expire_date} " +%s) " ]; then
80
+ profile_expire_date=$github_expire_date
81
+ else
82
+ echo " GitHub Actions detected, expiration date is not more than 90 days in the future."
83
+ fi
84
+ fi
85
+
75
86
plutil -replace com-loopkit-Loop-profile-expiration -date " ${profile_expire_date} " " ${info_plist_path} "
76
87
else
77
88
warn " Invalid provisioning profile path ${provisioning_profile_path} "
89
100
if [ -n " $branch " ]; then
90
101
plutil -replace com-loopkit-LoopWorkspace-git-branch -string " ${branch} " " ${info_plist_path} "
91
102
fi
92
- # determine if this is a GitHub Action build (with 90 day expiration)
93
- folderName=$( pwd)
94
- runnerString=" /Users/runner"
95
- if [ " ${folderName: 0: 13} " == " $runnerString " ]; then
96
- # overwrite profile_expire_date
97
- profile_expire_date=$( date -j -v+90d +" %Y-%m-%dT%H:%M:%SZ" )
98
- echo " runnerString detected, update profile_expire_date to ${profile_expire_date} "
99
- plutil -replace com-loopkit-Loop-profile-expiration -date " ${profile_expire_date} " " ${info_plist_path} "
100
- fi
101
103
popd . > /dev/null
102
104
fi
0 commit comments