Giter VIP home page Giter VIP logo

go-to-sleep's Introduction

The Github Go-To-Sleep-a-Tron Action

Sleepy Time

Stop coding and go to sleep!

Example Commit with Message

Inputs

GITHUB_TOKEN

Required
Just put ${{ secrets.GITHUB_TOKEN }} and it should work fine.

custom_mesage

Optional
Put your custom message as a HTML formatted string:
e.g. custom_message: "Oh dear, its very late where you are.\nWe appreciate your hard work but maybe you should go to bed."

Default: "Its quite late, maybe you should go to sleep!"

timezone

Required for any events other than commits (push)
Enter your team's timezone in the ISO format (+/-)hh:mm:
e.g. timezone: "+09:00"

How to use

If you do not have any Github actions already set up in your repo, start by creating a .github/workflows folder.

Inside your workflows folder, create a new .yml file, for example main.yml and copy the following lines:

on:
  [
    push,
    pull_request,                 # Slightly Supported
    pull_request_review,          # Not Supported
    pull_request_review_comment,  # Not Supported
    issues,                       # Not Supported
    issue_comment,                # Not Supported
  ]

jobs:
  go_to_sleep_job:
    runs-on: ubuntu-latest
    name: Go To Sleep-o-tron
    steps:
      - name: GTFTSleep
        id: hello
        uses: FraserTooth/go-to-sleep-action@master
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          timezone: "+09:00"
          custom_message: "Oh dear, its very late where you are.\n  We appreciate your hard work but maybe you should go to bed. </br>  <img src=\"https://media.giphy.com/media/C8hwMVdQFOUww/giphy.gif\" width=\"400\"/>"

Note: Remember to use HTML, not Markdown!

Feature TODOs

  • Configurable 'Out Of Bounds'
  • Add more action types
  • Add a 'per Github contributer' timezone
  • Allow configuration of posting to a basic Slack webhook or sending an Email to send notifications outside of Github

Testing

Locally, run npm install to get everything up and running

Download act and use the following commands to test locally

act -e ./test/<testFileYouWantToTry.json>

Make sure to run npm run build before testing locally

go-to-sleep's People

Contributors

frasertooth avatar

Watchers

 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.