openrewrite / openrewrite/rewrite-github-actions
Use multiline in `if` statements
Open
Nobody has claimed this yet.
recipe
- Dominant language
- Java
- Stars
- 1
- Forks
- 9
- Avg merge
- 5h 27m
- Merged PRs (30d)
- 12
Description
What problem are you trying to solve?
- Improve the readability of the workflows when multiple
ifconditions are used - Improve source control as single line changes are easier to reason about
What precondition(s) should be checked before applying this recipe?
The job uses multiple if conditions within a single line
Describe the situation before applying the recipe
if: ${{ !cancelled() && condition1 && condition2 && condition3 && condition4 && condition5 }}
Describe the situation after applying the recipe
if: ${{
!cancelled() &&
condition1 &&
condition2 &&
condition3 &&
condition4 &&
condition5 &&
}}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing recipe for GitHub Actions if conditions and its recipe unit tests. Use the before-and-after YAML examples in this issue to verify that a single-line expression with multiple conditions is rewritten into a multiline expression. Done means the transformation is covered by a unit test and preserves the conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions
- Domain
- ci-cd, devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100