From 1a990c25a4132a50e8c73f80c57845d7d9657399 Mon Sep 17 00:00:00 2001 From: Lars Trieloff Date: Tue, 18 Jul 2023 16:52:54 +0200 Subject: [PATCH] fix(github): restrict running of action to initial commit on main branch --- .github/workflows/cleanup-on-create.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cleanup-on-create.yaml b/.github/workflows/cleanup-on-create.yaml index 36eac2c92..8ad5e68ac 100644 --- a/.github/workflows/cleanup-on-create.yaml +++ b/.github/workflows/cleanup-on-create.yaml @@ -12,6 +12,8 @@ jobs: permissions: contents: write actions: write + # only run if commit message is "Initial commit" on main branch + if: ${{ github.ref == 'refs/heads/main' && github.event.head_commit.message == 'Initial commit' }} steps: - name: Checkout uses: actions/checkout@v3