Skip to content

Replace always() with success() || failure() - #225

Merged
timtebeek merged 4 commits into
openrewrite:mainfrom
Tyleresch:fix/replace-always-condition
Aug 25, 2026
Merged

Replace always() with success() || failure()#225
timtebeek merged 4 commits into
openrewrite:mainfrom
Tyleresch:fix/replace-always-condition

Conversation

@Tyleresch

@Tyleresch Tyleresch commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Add a recipe that replaces always() in GitHub Actions job and step conditions with success() || failure().

  • Cover workflow files and composite action definitions.

  • Preserve operator precedence in larger expressions and avoid changing function-like text inside string literals.

  • Preserve block scalar formatting and update generated recipe metadata.

  • Add positive and negative tests for job conditions, step conditions, composite actions, multiline expressions, unrelated keys, and non-GitHub Actions YAML.

  • Fixes Replace always() with success() || failure()  #42

@timtebeek
timtebeek merged commit 3e43a8c into openrewrite:main Aug 25, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Replace always() with success() || failure()

2 participants