Skip to content

Commit

Permalink
update if statement, so its cleaner
Browse files Browse the repository at this point in the history
deploy
  • Loading branch information
trueberryless committed Nov 19, 2024
1 parent d7adc3e commit c2457a1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions workflow-files/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions workflow-files/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2457a1

Please sign in to comment.