From c11d137e01559d6ee49ed8ce89e51fc0c0978a81 Mon Sep 17 00:00:00 2001 From: Romain Cascino Date: Thu, 21 May 2026 14:53:56 +0100 Subject: [PATCH] Allow passing document and release-notes flags --- README.md | 23 +++++++++++++++++++++++ action.yml | 8 ++++++++ run.sh | 7 +++++++ 3 files changed, 38 insertions(+) diff --git a/README.md b/README.md index d6862f3..d388372 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ Once installed, run it from your AI agent with `/linear-release-setup` (or just | `include_paths` | No | | Filter commits by file paths (comma-separated globs for monorepos) | | `base_ref` | No | | Override the `sync` scan base. Exclusive: scans `..HEAD` | | `links` | No | | Links to attach to the targeted release, one per line. Each value must be either an absolute URL or `Label=URL`. | +| `documents` | No | | Documents to attach to the targeted release, one per line as `[Title=]path/to/file.md` (title inferred from the filename if omitted). Existing documents with the same title are updated. | +| `release_notes` | No | | Path to a markdown file used as the release notes for this release. | | `log_level` | No | | Log verbosity: `quiet` or `verbose`. Omit for default output. | | `timeout` | No | `60` | Maximum time in seconds to wait for the command to complete | | `cli_version` | No | `v0.12.0` | Linear Release CLI version to install | @@ -182,6 +184,27 @@ When `base_ref` is provided, it overrides automatic base selection for that run. Deploy dashboard=https://deploys.example.com/v1.2.0 ``` +### Documents and release notes + +Attach release notes and supporting documents generated by your workflow. `release_notes` is a single file (last set wins if the action runs more than once for the same release). `documents` is repeatable and keyed by title — re-running the action with the same title updates the existing document in place. + +```yaml +- name: Build release artifacts + run: | + ./scripts/generate-changelog.sh > CHANGELOG.md + ./scripts/deploy.sh | tee deploy.log + +- uses: linear/linear-release-action@v0 + with: + access_key: ${{ secrets.LINEAR_ACCESS_KEY }} + release_notes: CHANGELOG.md + documents: | + Deploy log=deploy.log + docs/CHANGELOG.md +``` + +File paths are relative to the workflow's working directory. Omit `Title=` to infer the title from the filename (e.g. `docs/CHANGELOG.md` → `CHANGELOG`). + ## Versioning Each release of this action defaults to a specific [Linear Release CLI](https://github.com/linear/linear-release) version. Pinning the action — whether by tag (`@v0`) or commit SHA — also pins the CLI. Set `cli_version` to override. diff --git a/action.yml b/action.yml index 01a96b8..0d7ee53 100644 --- a/action.yml +++ b/action.yml @@ -35,6 +35,12 @@ inputs: links: description: Links to attach to the targeted release. Use one link per line. Each link must be either an absolute URL or "Label=URL". required: false + documents: + description: Documents to attach to the targeted release. One per line as "[Title=]path/to/file.md" (title inferred from the filename if omitted). Existing documents on the release with the same title are updated. + required: false + release_notes: + description: Path to a markdown file used as the release notes for this release. + required: false log_level: description: Log verbosity. Use "quiet" for errors only or "verbose" for detailed progress. Omit for default output. required: false @@ -83,6 +89,8 @@ runs: INPUT_INCLUDE_PATHS: ${{ inputs.include_paths }} INPUT_BASE_REF: ${{ inputs.base_ref }} INPUT_LINKS: ${{ inputs.links }} + INPUT_DOCUMENTS: ${{ inputs.documents }} + INPUT_RELEASE_NOTES: ${{ inputs.release_notes }} INPUT_LOG_LEVEL: ${{ inputs.log_level }} INPUT_TIMEOUT: ${{ inputs.timeout }} diff --git a/run.sh b/run.sh index ad770ec..e6dc993 100644 --- a/run.sh +++ b/run.sh @@ -56,6 +56,13 @@ if [[ -n "${INPUT_LINKS:-}" ]]; then args+=("--link=${link}") done <<<"${INPUT_LINKS}" fi +if [[ -n "${INPUT_DOCUMENTS:-}" ]]; then + while IFS= read -r doc || [[ -n "$doc" ]]; do + [[ "$doc" =~ ^[[:space:]]*$ ]] && continue + args+=("--document-file=${doc}") + done <<<"${INPUT_DOCUMENTS}" +fi +[[ -n "${INPUT_RELEASE_NOTES:-}" ]] && args+=("--release-notes-file=${INPUT_RELEASE_NOTES}") [[ -n "${INPUT_TIMEOUT:-}" ]] && args+=("--timeout=${INPUT_TIMEOUT}") if [[ -n "${INPUT_LOG_LEVEL:-}" ]]; then