Skip to content

Support Linear Action - #50

Merged
tonymeehan merged 2 commits into
prequel-dev:mainfrom
samgaw:samgaw/linear_action
Jun 5, 2025
Merged

tonymeehan merged 2 commits into
prequel-dev:mainfrom
samgaw:samgaw/linear_action

Conversation

@samgaw

@samgaw samgaw commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

Mirrors the jira action to add support for Linear issue tracker.

The action config block looks like:

- type: linear
    regex: "CRE-2025-0026"
    linear:
      team_id: "9cfb482a-81e3-4154-b5b9-2c805e70a02d"
      secret_env: LINEAR_TOKEN
      title_template: |
        [{{ field .cre "Id" }}] {{ field .cre "Title" }}
      description_template: |
        {{ stripdash (field .cre "Description") }}
        ### Impact
        {{ stripdash (field .cre "Impact") }}
        ### Cause
        {{ stripdash (field .cre "Cause") }}
        ## Mitigation
        {{ field .cre "Mitigation" }}
        {{- $refs := field .cre "References" -}}
        {{- if $refs }}
        ### References
        {{ range $refs }}
        - {{ . }}
        {{ end }}
        {{- end }}
        +++ ## Events
        {{- range .hits }}
          ```
          {{ .Entry }}
          ```
        {{- end }}
        +++

Also some CRE fields lead with a dash character which causes them to render as list items when they're interrupted as Markdown. So I added a stripdash function to the template helpers.

samgaw added 2 commits June 5, 2025 14:34
Some CRE fields lead with `-` which renders the block as a list item in
systems that render markdown.
@tonymeehan
tonymeehan self-requested a review June 5, 2025 16:13
Comment thread internal/pkg/runbook/runbook.go
@tonymeehan
tonymeehan self-requested a review June 5, 2025 16:32
@tonymeehan

Copy link
Copy Markdown
Contributor

Will merge once the CLA is signed! 🎸

@tonymeehan
tonymeehan merged commit cad1c12 into prequel-dev:main Jun 5, 2025
@samgaw
samgaw deleted the samgaw/linear_action branch June 5, 2025 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants