Skip to content
check-square

GitHub Action

Find or Create Linear Issue and Prefix PR

v0.60 Latest version

Find or Create Linear Issue and Prefix PR

check-square

Find or Create Linear Issue and Prefix PR

Ensure's every Pull Request has a Linear Issue associated with it and is displayed prominently in the title

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Find or Create Linear Issue and Prefix PR

uses: ctriolo/[email protected]

Learn more about this action in ctriolo/action-find-or-create-linear-issue

Choose a version

action-find-or-create-linear-issue

This is a Github Action that finds or creates a Linear Issue for your Pull Request. The Linear Issue identifier (e.g. ENG-123) is prefixed to the title of the PR.

This is helpful when you're:

  • Ensuring each Pull Request has a Linear Issue.

Inputs

Input Description Required
github-token GitHub token required to modify the PR title.
linear-api-key Linear API key generated from https://linear.app/settings/api . (e.g. lin_api_*)
linear-team-key Team key (e.g. ENG) for the created Linear issue.

Outputs

Output Description
linear-issue-id The Linear issue's unique identifier. (UUID)
linear-issue-identifier The Linear issue's human readable identifier. (e.g. ENG-123)
linear-issue-number The Linear issue's number. (e.g. the 123 of ENG-123)
linear-issue-title The Linear issue's title.
linear-issue-description The Linear issue's description.
linear-issue-url The Linear issue's URL. (e.g. https://...)
linear-team-id The Linear teams unique identifier. (UUID)
linear-team-key The Linear teams key/prefix (e.g. ENG)
did-create true if a Linear issue was created using this action.

Example usage

Create Linear Issue on Pull Request

name: Find or Create Linear Issue in Pull Request

on:
  workflow_dispatch:
  pull_request:
    branches:
      - main
    types: ["opened", "edited", "reopened", "synchronize"]

permissions:
  pull-requests: write

jobs:
  create-linear-issue-on-pull-request:
    runs-on: ubuntu-latest
    steps:
      - name: Find or create a Linear Issue
        uses: ctriolo/action-find-or-create-linear-issue@v1
        with:
          github-token: ${{secrets.GITHUB-TOKEN}}
          linear-api-key: ${{secrets.LINEAR_API_KEY}}
          linear-team-key: "ENG"