Home / Blog / No Deploy Friday action
cicd ·

No Deploy Friday action

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

No Deploy Friday action

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:

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:

GitHub Actions

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

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.

Newsletter
Enjoyed this post?
Get new posts straight to your inbox. No spam, ever.
Subscribe →

Share your thoughts