From 816968c9bf48670a62fe7d767e7f72c0d96b8756 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 13 Jul 2022 12:36:11 +0100 Subject: [PATCH] Adds automations to notify if domain expiring --- .github/workflows/check-domain.yml | 42 ++++++++++++++++++++ .github/workflows/welcome-non-stargazers.yml | 18 +++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/check-domain.yml create mode 100644 .github/workflows/welcome-non-stargazers.yml diff --git a/.github/workflows/check-domain.yml b/.github/workflows/check-domain.yml new file mode 100644 index 0000000..542dc77 --- /dev/null +++ b/.github/workflows/check-domain.yml @@ -0,0 +1,42 @@ +# Checks domain and SSL status, then raises an issue if either is expiring soon +name: 🌎 Check Domain Expiry +on: + workflow_dispatch: + schedule: + - cron: '0 5 * * 6' # Every Saturday morning. +jobs: + check-domain: + runs-on: ubuntu-latest + name: Check domain + strategy: + matrix: + domain: + - https://awesome-privacy.xyz + steps: + - name: Check domain SSL and registry expire date + id: check-domain + uses: codex-team/action-check-domain@v1 + with: + url: ${{ matrix.domain }} + - name: Raise issue if domain expiring soon + if: ${{ steps.check-domain.outputs.paid-till-days-left && steps.check-domain.outputs.paid-till-days-left < 30 }} + uses: rishabhgupta/git-action-issue@v2 + with: + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + assignees: Lissy93 + title: '[WEBSITE] Domain Expiring Soon' + body: > + **Priority Notice** + Domain, ${{ matrix.domain }} will expire in ${{ steps.check-domain.outputs.paid-till-days-left }} days. + @Lissy93 - Please take action immediately to prevent any downtime + - name: Raise issue if SSL Cert expiring soon + if: ${{ steps.check-domain.outputs.ssl-expire-days-left && steps.check-domain.outputs.ssl-expire-days-left < 14 }} + uses: rishabhgupta/git-action-issue@v2 + with: + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + assignees: Lissy93 + title: '[WEBSITE] SSL Cert Expiring Soon' + body: > + **Priority Notice** + The SSL Certificate for ${{ matrix.domain }} will expire in ${{ steps.check-domain.outputs.ssl-expire-days-left }} days, on ${{ steps.check-domain.outputs.ssl-expire-date }}. + @Lissy93 - Please take action immediately to prevent any downtime diff --git a/.github/workflows/welcome-non-stargazers.yml b/.github/workflows/welcome-non-stargazers.yml new file mode 100644 index 0000000..57091ec --- /dev/null +++ b/.github/workflows/welcome-non-stargazers.yml @@ -0,0 +1,18 @@ +name: ⭐ Hello non-Stargazers +on: + issues: + types: [opened] +jobs: + check-user: + if: ${{ github.event.comment.author_association != 'CONTRIBUTOR' }} + runs-on: ubuntu-latest + name: Add comment to issues opened by non-stargazers + steps: + - name: comment + uses: qxip/please-star-light@v4 + with: + token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + autoclose: false + message: | + If you're enjoying Awesome-Privacy, consider dropping us a ⭐
+ _🤖 I'm a bot, and this message was automated_