typesafegithub / typesafegithub/github-workflows-kt

[Core feature request] Support operators for type-safe expressions

Open
#372 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Kotlin
Stars
664
Forks
30
Avg merge
4d 19h
Merged PRs (30d)
5

Description

What feature do you need?
https://docs.github.com/en/actions/learn-github-actions/expressions#operators
It would be nice if you could construct more complex expressions using operators with the type-safe expr API.
One way would be to model them as explicit functions like expr { and(always(), success()) } to get ${{ always() && success() }}.
An even nicer way would of course be if operator overloading is used, so that you can actually do expr { always() && success() }} instead.
Those ways also need to support some way of textual input to support not yet supported contexts like step outcome, or matrix values.

Do you have an example usage?

if: always() && (steps.execute_action.outcome == 'success')

Is there a workaround for not having this feature? If yes, please describe it.
Work-around is to not use the type-safe API, but simple strings.

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 type-safe expr API and the linked GitHub Actions expressions operator documentation. Compare the proposed explicit functions, operator overloading, and textual input for unsupported contexts such as step outcomes and matrix values; done means the API can represent the example expression without falling back to plain strings.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, kotlin
Domain
ci-cd, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.