From 2611b351cc27c0f69e88a01944a0a8af5cbdbd34 Mon Sep 17 00:00:00 2001 From: Christopher Triolo Date: Wed, 24 May 2023 18:16:54 -0700 Subject: [PATCH] add label support --- .github/workflows/pull-request.yml | 1 + action.yml | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 16009ab..6c30b1b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -28,6 +28,7 @@ jobs: linear-team-key: "CHR" linear-created-issue-title-prefix: "[GITHUB] " # Done linear-created-issue-state-id: "d8dc0111-0862-4ea9-8eb5-e7c127f847ce" # Done + linear-issue-label-ids: "ea7fc863-71f7-409c-bcda-b42a22dc9a75,7c8d0d42-b53c-49c4-ba23-b48f6e14eb62,77c37057-9bd9-413b-a8b8-5aabd7c1a557" - name: Create comment in PR with Linear Issue link uses: peter-evans/create-or-update-comment@v2 with: diff --git a/action.yml b/action.yml index 030b011..034b809 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,8 @@ inputs: description: "Team state ID for the created Linear issue." linear-created-issue-title-prefix: description: "Title prefix for the created Linear issue." + linear-issue-label-ids: + description: "Comma deliminated label ids" github-token: description: "GitHub token required to modify the PR title." required: true @@ -54,13 +56,14 @@ runs: - name: Find the Linear Issue. continue-on-error: true id: find - uses: ctriolo/action-find-linear-issue@v0.2 + uses: ctriolo/action-find-linear-issue@v0.5 with: linear-api-key: ${{inputs.linear-api-key}} + linear-issue-label-ids: ${{inputs.linear-issue-label-ids}} - name: Create the Linear Issue if no identifier found. id: create if: ${{always() && steps.find.outcome == 'failure'}} - uses: ctriolo/action-create-linear-issue@v0.4 + uses: ctriolo/action-create-linear-issue@v0.5 with: linear-api-key: ${{inputs.linear-api-key}} linear-team-key: ${{inputs.linear-team-key}} @@ -69,6 +72,7 @@ runs: linear-issue-state-id: ${{inputs.linear-created-issue-state-id}} linear-attachment-url: ${{github.event.pull_request.html_url}} linear-attachment-title: "(#${{github.event.pull_request.number}}) ${{github.event.pull_request.title}}" + linear-issue-label-ids: ${{inputs.linear-issue-label-ids}} - name: Prepend the title with the Linear issue identifier. # Not enforcing that the found or created task is at the start for in the case of multiple tasks in the title. if: ${{!contains(github.event.pull_request.title, steps.find.outputs.linear-issue-identifier || steps.create.outputs.linear-issue-identifier)}}