Git Product home page Git Product logo

action-check-domain's Introduction

Domain and SSL cert watcher

Watch SSL certs and registry date expiring for your domains.

banner

Inputs

url

Site domain to be checked (with protocol).

Outputs

ssl-expire-date

SSL certificate expire date

ssl-expire-days-left

SSL certificate expire number of days left

paid-till-date

Registry Expiry Date

paid-till-days-left

Registry Expiry number of days left

Example usage

- name: Check domain SSL and registry expire date
  id: check-domain
  uses: codex-team/action-check-domain@v1
  with:
    url`: ${{ matrix.domain }}

- run: echo 'SSL cert has ${{ steps.check-domain.outputs.ssl-expire-days-left }} days left'
  if: ${{ steps.check-domain.outputs.ssl-expire-days-left }}

Advanced example

You can create a workflow based on this action for checking your domains.

Run will be scheduled by cron every day near 8:00 UTC (several minutes later because of github doesn't call your scripts at the time).

If paid till (or SSL lifespan days) number is below limit (for example 10 days) then will be created a new issue.

name: Check domains

on:
  schedule:
    - cron:  '0 8 * * *'

jobs:
  hello:
    runs-on: ubuntu-latest
    name: Check domain
    strategy:
      matrix:
        domain:
          - https://codex.so
          - https://editorjs.io
    steps:
      - name: Check domain SSL and registry expire date
        id: check-domain
        uses: codex-team/action-check-domain@v1
        with:
          url: ${{ matrix.domain }}

      - name: Create an issue if paid till number is below limit 
        if: ${{ steps.check-domain.outputs.paid-till-days-left && steps.check-domain.outputs.paid-till-days-left < 10 }}
        uses: rishabhgupta/git-action-issue@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          title: ⚠️ ${{ matrix.domain }} — registry expiries in ${{ steps.check-domain.outputs.paid-till-days-left }} days
          body: 'Paid till: `${{ steps.check-domain.outputs.paid-till-date }}`'

      - name: Create an issue if SSL lifespan days number is below limit 
        if: ${{ steps.check-domain.outputs.ssl-expire-days-left && steps.check-domain.outputs.ssl-expire-days-left < 10 }}
        uses: rishabhgupta/git-action-issue@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          title: 🧨 ${{ matrix.domain }} — SSL cert expires in ${{ steps.check-domain.outputs.ssl-expire-days-left }} days
          body: 'Valid till: `${{ steps.check-domain.outputs.ssl-expire-date }}`'

action-check-domain's People

Contributors

talyguryn avatar iineva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.