Coder Social home page Coder Social logo

no-weekend-merge's Introduction

No Weekend Merge

Merging PRs that trigger some workflows on weekends or after work hours might break something without anyone being around to fix the issue. You can prevent merges during these time using this action.

Inputs

Time zone (required):

Input name: tz

The time zone that the downtimes are specified in, e.g. -5 for Chicago and 3.5 for Tehran. The default value is 0.

Days (optional):

There are seven inputs for the days of the week. Each day accepts a comma-separated list of downtime durations. Each downtime duration must match the following regex pattern: /(?<fromHour>\d{2}):(?<fromMinute>\d{2})-(?<toHour>\d{2}):(?<toMinute>\d{2})/

Input names: mon, tue, wed, thu, fri, sat, sun

For example, the following inputs prevent merges in the given time zone on all hours on weekends, and 00:00 to 07:00 and 16:30 to 23:59 on weekdays.

mon: '00:00-07:00,16:30-23:59'
tue: '00:00-07:00,16:30-23:59'
wed: '00:00-07:00,16:30-23:59'
thu: '00:00-07:00,16:30-23:59'
fri: '00:00-07:00,16:30-23:59'
sat: '00:00-23:59'
sun: '00:00-23:59'

Usage

You can use this action by adding the following step to your workflow:

name: Check merge
on:
  pull_request:
  push:
    branches:
      - main
jobs:
  no-weekend-merge:
    runs-on: ubuntu-latest
    steps:
    - name: Check for downtimes
      uses: ka7eh/no-weekend-merge@releases/v0.1
      with:
        tz: '-5'
        mon: '00:00-07:00,16:30-23:59'
        tue: '00:00-07:00,16:30-23:59'
        wed: '00:00-07:00,16:30-23:59'
        thu: '00:00-07:00,16:30-23:59'
        fri: '00:00-07:00,16:30-23:59'
        sat: '00:00-23:59'
        sun: '00:00-23:59'

no-weekend-merge's People

Contributors

dependabot[bot] avatar ka7eh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cory-baker

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.