-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SSL_TEST_RESULT message / icons
- Loading branch information
1 parent
534c0b3
commit 7e4467e
Showing
1 changed file
with
16 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,9 @@ concurrency: | |
env: | ||
USER: ${{ github.actor }} | ||
|
||
# Number of days in Advance to warn of SSL certificate expiry | ||
SSL_EXPIRY_NOTICE_DAYS: 200 # Using long period to test notification on issue detected | ||
|
||
# Skip builds for faster deployments / testing ("YES" or build) | ||
SKIP_BUILDS: "YES" | ||
SKIP_DEPLOY: "YES" | ||
|
@@ -15,10 +18,6 @@ env: | |
BUILD_ID: ${{ github.event.number }} | ||
INSPECT_JOB_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
|
||
BUILD_ICON_URL: https://cdn-icons-png.flaticon.com/128/5110/5110294.png | ||
SUCCESS_ICON_URL: https://cdn-icons-png.flaticon.com/128/1356/1356479.png | ||
FAIL_ICON_URL: https://www.flaticon.com/free-icon/rocket_6818114 | ||
|
||
on: | ||
schedule: | ||
- cron: "0 3 * * 6" | ||
|
@@ -291,13 +290,21 @@ jobs: | |
with: | ||
name: lighthouse-artifacts | ||
path: artifacts | ||
- name: Set Emoji for Notification Status Icon | ||
- name: Set Emoji for SSL Status Icon | ||
id: notification-emoji | ||
run: | | ||
if [[ "${{ needs.call-deploy-workflow.result }}" == "success" ]]; then | ||
if [[ "${{ needs.lighthouse-check.result }}" == "success" ]]; then | ||
`echo "EMOJI=:rocket:" >> $GITHUB_OUTPUT` | ||
else | ||
`echo "EMOJI=:boom:" >> $GITHUB_OUTPUT` | ||
fi | ||
- name: Set Emoji for Notification Status Icon | ||
id: ssl-status-emoji | ||
run: | | ||
if [[ "${{ needs.lighthouse-check.outputs.SSL_EXPIRY_DAYS }}" < ${{ env.SSL_EXPIRY_NOTICE_DAYS }} ]]; then | ||
`echo "SSL_TEST_RESULT=:warn: Warning! SSL Certificate will EXPIRE in ${{ needs.lighthouse-check.outputs.SSL_EXPIRY_DAYS }} days." >> $GITHUB_OUTPUT` | ||
else | ||
`echo "EMOJI=:boom:" >> $GITHUB_OUTPUT` | ||
`echo "SSL_TEST_RESULT=:check: SSL Certificat EXPIRES in ${{ needs.lighthouse-check.outputs.SSL_EXPIRY_DAYS }} days." >> $GITHUB_OUTPUT` | ||
fi | ||
- name: 📫 Send Notification | ||
uses: muinmomin/[email protected] | ||
|
@@ -333,8 +340,8 @@ jobs: | |
"title": "Lighthouse Test Results:", | ||
"value": "${{ needs.lighthouse-check.outputs.LHRESULT }}" | ||
},{ | ||
"title": "SSL Certificate Expiry", | ||
"value": "SSL certificate will expire in ${{ needs.lighthouse-check.outputs.SSL_EXPIRY_DAYS }} days." | ||
"title": "SSL Certificate Expiry:", | ||
"value": "${{ steps.notification-emoji.outputs.SSL_TEST_RESULT }}" | ||
}] | ||
}] | ||
} |