openrewrite / openrewrite/rewrite-github-actions

Add condition to existing conditional execution

Open
#65 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

recipe
Dominant language
Java
Stars
1
Forks
9
Avg merge
5h 27m
Merged PRs (30d)
12

Description

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')

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing conditional execution recipe and the example in .github/workflows/onboarding.yaml. Verify how the current condition is represented and covered by tests, then ensure the recipe can extend it with the shown expression while preserving the existing condition; done means the resulting workflow contains both conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.