Skip to content

Commit

Permalink
Merge pull request #7 from ctriolo/chris/add-label-support
Browse files Browse the repository at this point in the history
CHR-40: add label support
  • Loading branch information
ctriolo authored May 25, 2023
2 parents 14cac15 + 2611b35 commit b7e5ba9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}}
Expand All @@ -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)}}
Expand Down

0 comments on commit b7e5ba9

Please sign in to comment.