10
10
paths :
11
11
- " .github/workflows/check-certificates.ya?ml"
12
12
schedule :
13
- # run every 10 hours
13
+ # Run every 10 hours.
14
14
- cron : " 0 */10 * * *"
15
15
workflow_dispatch :
16
16
repository_dispatch :
17
17
18
18
env :
19
- # Begin notifications when there are less than this many days remaining before expiration
19
+ # Begin notifications when there are less than this many days remaining before expiration.
20
20
EXPIRATION_WARNING_PERIOD : 30
21
21
22
22
jobs :
@@ -32,14 +32,15 @@ jobs:
32
32
33
33
matrix :
34
34
certificate :
35
- - identifier : macOS signing certificate # Text used to identify the certificate in notifications
36
- certificate-secret : INSTALLER_CERT_MAC_P12 # The name of the secret that contains the certificate
37
- password-secret : INSTALLER_CERT_MAC_PASSWORD # The name of the secret that contains the certificate password
35
+ # Additional certificate definitions can be added to this list.
36
+ - identifier : macOS signing certificate # Text used to identify certificate in notifications.
37
+ certificate-secret : INSTALLER_CERT_MAC_P12 # Name of the secret that contains the certificate.
38
+ password-secret : INSTALLER_CERT_MAC_PASSWORD # Name of the secret that contains the certificate password.
38
39
39
40
steps :
40
41
- name : Set certificate path environment variable
41
42
run : |
42
- # See: https://docs.github.com/en/free-pro-team@latest/ actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
43
+ # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
43
44
echo "CERTIFICATE_PATH=${{ runner.temp }}/certificate.p12" >> "$GITHUB_ENV"
44
45
45
46
- name : Decode certificate
61
62
exit 1
62
63
)
63
64
64
- # See: https://github.com/rtCamp/action-slack-notify
65
65
- name : Slack notification of certificate verification failure
66
66
if : failure()
67
67
env :
@@ -101,7 +101,7 @@ jobs:
101
101
102
102
DAYS_BEFORE_EXPIRATION="$((($(date --utc --date="$EXPIRATION_DATE" +%s) - $(date --utc +%s)) / 60 / 60 / 24))"
103
103
104
- # Display the expiration information in the log
104
+ # Display the expiration information in the log.
105
105
echo "Certificate expiration date: $EXPIRATION_DATE"
106
106
echo "Days remaining before expiration: $DAYS_BEFORE_EXPIRATION"
107
107
@@ -116,7 +116,7 @@ jobs:
116
116
fi
117
117
118
118
- name : Slack notification of pending certificate expiration
119
- # Don't send spurious expiration notification if verification fails
119
+ # Don't send spurious expiration notification if verification fails.
120
120
if : failure() && steps.check-expiration.outcome == 'failure'
121
121
env :
122
122
SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
0 commit comments