Skip to content

Commit

Permalink
Merge pull request #6 from ctriolo/ctriolo/add-state-id
Browse files Browse the repository at this point in the history
CHR-35: add state id
  • Loading branch information
ctriolo authored Jan 10, 2023
2 parents 7945f5d + d361dfa commit 14cac15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ jobs:
- name: Checkout action repo
uses: actions/checkout@v3
- name: (STEP) Find or Create the Linear Issue on Pull Request
id: findOrCreateIssue
uses: ./ # Uses an action in the root directory
with:
github-token: ${{secrets.GITHUB_TOKEN}}
linear-api-key: ${{secrets.LINEAR_API_KEY}}
linear-team-key: "CHR"
linear-created-issue-title-prefix: "[GITHUB] " # Done
linear-created-issue-state-id: "d8dc0111-0862-4ea9-8eb5-e7c127f847ce" # Done
- name: Create comment in PR with Linear Issue link
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{secrets.GITHUB_TOKEN}}
issue-number: ${{ github.event.pull_request.number }}
body: |
${{ steps.findOrCreateIssue.outputs.linear-issue-url }}
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
linear-team-key:
description: "Team key (e.g. ENG) for the Linear issue to create."
required: true
linear-created-issue-state-id:
description: "Team state ID for the created Linear issue."
linear-created-issue-title-prefix:
description: "Title prefix for the created Linear issue."
github-token:
description: "GitHub token required to modify the PR title."
required: true
Expand Down Expand Up @@ -56,12 +60,13 @@ runs:
- name: Create the Linear Issue if no identifier found.
id: create
if: ${{always() && steps.find.outcome == 'failure'}}
uses: ctriolo/action-create-linear-issue@v0.2
uses: ctriolo/action-create-linear-issue@v0.4
with:
linear-api-key: ${{inputs.linear-api-key}}
linear-team-key: ${{inputs.linear-team-key}}
linear-issue-title: ${{github.event.pull_request.title}}
linear-issue-title: "${{inputs.linear-created-issue-title-prefix}}${{github.event.pull_request.title}}"
linear-issue-description: ${{github.event.pull_request.body}}
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}}"
- name: Prepend the title with the Linear issue identifier.
Expand Down

0 comments on commit 14cac15

Please sign in to comment.