Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ 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) |
| `include_subjects` | No | | Filter commits whose subject (first line) matches a regular expression. Composes with `include_paths`. |
| `issue_pattern` | No | | Extract issue identifiers captured by group 1 of a regular expression from commit subjects. Additive to the built-in detection. |
| `no_branch_ref_detection` | No | `false` | Disable issue detection from git branch refs during `sync`. Maps to CLI `--no-branch-ref-detection`. |
| `base_ref` | No | | Override the `sync` scan base. Exclusive: scans `<base_ref>..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. |
Expand Down Expand Up @@ -183,6 +184,19 @@ Use `issue_pattern` when commit subjects reference issues in a convention the bu
issue_pattern: '\[([A-Z]+-\d+)\]'
```

### Disable branch ref detection

Set `no_branch_ref_detection: true` for `sync` to ignore git branch refs when detecting issues. This prevents an unrelated branch that points at a released commit from contributing its issue identifier.

Commit-message issue detection, source branches recorded in merge messages, PR/MR references, and custom `issue_pattern` matching remain enabled. This also disables legitimate issue attribution that relies only on branch refs, such as fast-forward commits with no issue reference in their messages. The default is `false`.

```yaml
- uses: linear/linear-release-action@v0
with:
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
no_branch_ref_detection: true
```

### Scan base override

Use `base_ref` to explicitly choose the exclusive lower bound for `sync`'s commit scan. This is useful when the automatically selected release baseline is not the range you want for a custom branching workflow, first-time onboarding, or migration.
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ inputs:
issue_pattern:
description: 'Extract issue identifiers captured by group 1 of a regular expression from commit subjects (e.g., "\[([A-Z]+-\d+)\]"). Additive to the built-in detection.'
required: false
no_branch_ref_detection:
description: 'When "true", disable issue detection from git branch refs during sync. Commit-message detection, including source branches in merge messages, remains enabled.'
required: false
default: "false"
base_ref:
description: "Override the sync scan base. Exclusive: scans <base_ref>..HEAD."
required: false
Expand Down Expand Up @@ -104,6 +108,7 @@ runs:
INPUT_INCLUDE_PATHS: ${{ inputs.include_paths }}
INPUT_INCLUDE_SUBJECTS: ${{ inputs.include_subjects }}
INPUT_ISSUE_PATTERN: ${{ inputs.issue_pattern }}
INPUT_NO_BRANCH_REF_DETECTION: ${{ inputs.no_branch_ref_detection }}
INPUT_BASE_REF: ${{ inputs.base_ref }}
INPUT_LINKS: ${{ inputs.links }}
INPUT_DOCUMENTS: ${{ inputs.documents }}
Expand Down
9 changes: 9 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ fi
[[ -n "${INPUT_RELEASE_NOTES:-}" ]] && args+=("--release-notes-file=${INPUT_RELEASE_NOTES}")
[[ -n "${INPUT_TIMEOUT:-}" ]] && args+=("--timeout=${INPUT_TIMEOUT}")

case "${INPUT_NO_BRANCH_REF_DETECTION:-false}" in
true) args+=("--no-branch-ref-detection") ;;
false|"") ;;
*)
echo "::error::Invalid no_branch_ref_detection '${INPUT_NO_BRANCH_REF_DETECTION}'. Must be: true or false"
exit 1
;;
esac

case "${INPUT_DRY_RUN:-false}" in
true) args+=("--dry-run") ;;
false|"") ;;
Expand Down
Loading