Skip to content

Commit

Permalink
Added SSL_TEST_RESULT message / icons
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenchristian1telus committed Oct 1, 2024
1 parent 534c0b3 commit 7e4467e
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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 }}"
}]
}]
}

0 comments on commit 7e4467e

Please sign in to comment.