openrewrite / rewrite-github-actions

OpenRewrite recipes for performing GitHub action hygiene and migration tasks.
Apache License 2.0
9 stars 9 forks source link

Add condition to existing conditional execution #65

Open yeikel opened 1 year ago

yeikel commented 1 year ago

This recipe should allow adding to an existing condition given the expression


diff --git a/.github/workflows/onboarding.yaml b/.github/workflows/onboarding.yaml
index 56bd473..cdec9e5 100644
--- a/.github/workflows/onboarding.yaml
+++ b/.github/workflows/onboarding.yaml
@@ -80,7 +80,7 @@ jobs:
   validate:
     name: Validate
-    if: contains(github.event.issue.labels.*.name, 'onboarding')
+    if: contains(github.event.issue.labels.*.name, 'onboarding') || startsWith(github.event.issue.title,'Onboarding')