Skip to content

feat(action): expose release outputs (released, releases JSON) #205

Description

@BryanFRD

Package
Which package does this affect? [x] cli [ ] schema [ ] docs [x] ci

Problem / Motivation
The GitHub Action (FerrFlow-Org/ferrflow@v2) currently runs ferrflow release but exposes no outputs. Downstream workflows have no way to know if a release happened or which packages were released, making it impossible to conditionally run post-release steps (npm publish, Docker build, deploy, etc.).

In monorepos, FerrFlow may release multiple packages in a single run. Consumers need per-package information to trigger the right build/publish steps. Single-package repos also need a simple boolean to gate post-release jobs.

Proposed solution
Proposal

Alternatives considered
None considered explicitly — this is the natural shape.

Additional context
CLI side

Add a --output-format flag with support for multiple formats:

  • github — writes to $GITHUB_OUTPUT (GitHub Actions native)
  • dotenv — writes a .env file (GitLab CI artifacts:reports:dotenv compatible)
  • json — writes a JSON file

Combined with --output-file to specify the destination.

Output content

When a release happens:

github format (appended to $GITHUB_OUTPUT):

released=true
releases=[{"name":"mcp","version":"3.0.0","tag":"v3.0.0"}]

dotenv format:

FERRFLOW_RELEASED=true
FERRFLOW_RELEASES=[{"name":"mcp","version":"3.0.0","tag":"v3.0.0"}]

json format:

{"released":true,"releases":[{"name":"mcp","version":"3.0.0","tag":"v3.0.0"}]}

When nothing is released:

released=false / FERRFLOW_RELEASED=false
releases=[] / FERRFLOW_RELEASES=[]

The data is already available in tags_to_create in monorepo.rs.

Action side (GitHub)

Add outputs to action.yml:

outputs:
 released:
 description: 'Whether at least one package was released'
 value: ${{ steps.ferrflow.outputs.released }}
 releases:
 description: 'JSON array of released packages with name, version, and tag'
 value: ${{ steps.ferrflow.outputs.releases }}

Usage examples

GitHub Actions — single package:

- uses: FerrFlow-Org/ferrflow@v3
 id: release
- name: Publish
 if: steps.release.outputs.released == 'true'
 run: npm publish

GitHub Actions — monorepo:

- uses: FerrFlow-Org/ferrflow@v3
 id: release
- name: Build released packages
 if: steps.release.outputs.released == 'true'
 run: |
 echo '${{ steps.release.outputs.releases }}' | jq -r '.[].name' | while read pkg; do
 pnpm --filter "$pkg" build
 done

GitLab CI — dotenv:

release:
 script:
 - ferrflow release --output-format dotenv --output-file ferrflow.env
 artifacts:
 reports:
 dotenv: ferrflow.env

build:
 needs: [release]
 rules:
 - if: $FERRFLOW_RELEASED == "true"
 script:
 - pnpm build

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority / someday

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions