ForNeVeR / ForNeVeR/Generaptor

Support job outputs (pass values between jobs)

Open
#140 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
F#
Stars
50
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Problem
Generaptor does not support GitHub Actions job `outputs`. A job cannot publish a value for other jobs to read.

In plain GitHub Actions YAML, this looks like:
```yaml
jobs:
build:
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- id: version
run: echo "version=1.2.3" >> "$GITHUB_OUTPUT"

release:
needs: build
runs-on: ubuntu-24.04
steps:
- run: echo "Version is ${{ needs.build.outputs.version }}"
```

The `Job` type in `Generaptor/GitHubActions.fs` has no `Outputs` field, and there is no DSL command to set one. So this pattern cannot be expressed today.

## My workaround
I have a `publish` job and a `release` job. `release` needs a version string that `publish` also needs. Since there's no way to pass it between jobs, I just compute the version again in `release`, using the same script. This only works because the computation is cheap and always gives the same result. It would not work for a value that is expensive to compute, random, or comes from an external call.

## Suggestion
1. A command to set a job output, e.g. `jobOutput(name, value)`.
2. A way to read another job's output, e.g. a helper `needsOutput(jobId, outputName)` that returns the `${{ needs..outputs. }}` string. Or, just document how to write that expression by hand once part 1 exists.

Contributor guide

Open the contributing guide

Research direction

Start by reading the Job type in Generaptor/GitHubActions.fs and locating the existing DSL commands that configure jobs. Define completion as being able to express a job output and reference another job's output using the GitHub Actions syntax shown in the issue; add or update tests only where the repository's existing structure indicates them.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.