# No Deploy Friday action

- Author: Maciek Palmowski (https://maciekpalmowski.dev/)
- Published: 2022-09-28
- Topics: cicd
- URL: https://maciekpalmowski.dev/blog/no-deploy-friday-action/

> How to block Friday deployments using CI/CD pipelines — simple bash snippets for both Buddy and GitHub Actions to prevent accidental weekend-ruining releases.

There is no worst idea than deploying on Friday. Here I will show you how to prevent it at a pipeline level.

At some point, **Volkan Özçelik** mentioned an idea about preventing deployments on Friday. In general, it's straightforward to add such an action.

## Buddy

We just have to a local shell action with:

```bash
if [[ $(date +%u) == 5 ]]; then echo 'Do not deploy on Friday.' && exit 1; fi;
```

and that's it. In the end, our pipeline would look like this:

*[Image: Buddy pipeline for a Jekyll site: Build Jekyll, No deploy on Friday, Upload files and Check if website is working.]*

## GitHub Actions

If you are more into GHA, then just add something like this before the deploy action:

```yaml
jobs:
  example-job:
    runs-on: ubuntu-latest
    name: Block on Friday
    steps:
      - shell: bash
        run: |
          if [[ $(date +%u) == 5 ]]; then echo 'Do not deploy on Friday.' && exit 1; fi;
```

## Time to sum up

Will this work? Of course, it will. Should you use it? Rather not - it's a bit of a joke. Things like this should be handled at the organizational level.

But if for some reason you see that Friday deployments are a problem at your company - then don't hesitate to add this to your pipelines.
