From c2457a176f9df8b6c34ed226c4bb10f17f2188f6 Mon Sep 17 00:00:00 2001 From: trueberryless Date: Tue, 19 Nov 2024 13:39:43 +0100 Subject: [PATCH] update if statement, so its cleaner deploy --- .github/workflows/sync.yaml | 10 +++++++++- workflow-files/deployment.yaml | 11 +++++++++-- workflow-files/publish.yaml | 11 +++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml index 680489a..fd74411 100644 --- a/.github/workflows/sync.yaml +++ b/.github/workflows/sync.yaml @@ -44,7 +44,15 @@ jobs: sync-workflows: runs-on: ubuntu-latest needs: changesets - if: (needs.changesets.outputs.hasChangesets == 'false' && (contains(github.event.head_commit.message, 'deploy') || contains(github.event.head_commit.message, '[ci] release'))) || github.event_name == 'workflow_dispatch' + if: > + ( + needs.changesets.outputs.hasChangesets == 'false' && + ( + contains(github.event.head_commit.message, 'deploy') || + contains(github.event.head_commit.message, '[ci] release') + ) + ) || + github.event_name == 'workflow_dispatch' steps: # Step 1: Checkout current repository - name: Checkout current repository diff --git a/workflow-files/deployment.yaml b/workflow-files/deployment.yaml index bdaf3c7..27781dc 100644 --- a/workflow-files/deployment.yaml +++ b/workflow-files/deployment.yaml @@ -84,8 +84,15 @@ jobs: deployment: needs: [changes, changesets, image-tag] - # Only run if there is no changeset (i.e. a release), there are changes to the <%= documentationFolder %> and the commit message contains '[ci] release' or 'deploy' (workflow_dispatch supported) - if: (needs.changes.outputs.<%= documentationFolder %> == 'true' && needs.changesets.outputs.hasChangesets == 'false' && (contains(github.event.head_commit.message, 'deploy') || contains(github.event.head_commit.message, '[ci] release'))) || github.event_name == 'workflow_dispatch' + if: > + ( + needs.changesets.outputs.hasChangesets == 'false' && + ( + contains(github.event.head_commit.message, 'deploy') || + contains(github.event.head_commit.message, '[ci] release') + ) + ) || + github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: write diff --git a/workflow-files/publish.yaml b/workflow-files/publish.yaml index 2a26936..5cb6dbf 100644 --- a/workflow-files/publish.yaml +++ b/workflow-files/publish.yaml @@ -84,8 +84,15 @@ jobs: publish: needs: [changes, changesets, image-tag] - # Only run if there is no changeset (i.e. a release), there are changes to the packages/<%= packageName %> and the commit message contains '[ci] release' or 'deploy' (workflow_dispatch supported) - if: (needs.changes.outputs.<%= packageName %> == 'true' && needs.changesets.outputs.hasChangesets == 'false' && (contains(github.event.head_commit.message, 'deploy') || contains(github.event.head_commit.message, '[ci] release'))) || github.event_name == 'workflow_dispatch' + if: > + ( + needs.changesets.outputs.hasChangesets == 'false' && + ( + contains(github.event.head_commit.message, 'deploy') || + contains(github.event.head_commit.message, '[ci] release') + ) + ) || + github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: write