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