Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mprzytulski committed Jul 10, 2023
1 parent 2accfd9 commit 1253ada
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# action-linear-create-issue

This is a [Github Action](https://github.com/features/actions) that allows to create project and issue links


## Inputs

| Input | Description | Required |
|-----------------------|------------------------------------------------------------------------------------|----------|
| `linear-api-key` | Linear API key generated from https://linear.app/settings/api . (e.g. `lin_api_*)` ||
| `scope` | project or issue ids ||
| `resource` | UUID of the resource ||
| `name` | Descriptive name of the link ||
| `target` | Destination URL ||


## Example usage

### Create a comment with Linear Issue on Pull Request

```yaml
name: Create a link in the linear

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

jobs:
comment-with-linear-issue-on-pull-request:
runs-on: ubuntu-latest
steps:
- name: Find the Linear Issue
id: findIssue
uses: epsylabs/action-find-linear-issue@main
with:
linear-api-key: ${{secrets.LINEAR_API_KEY}}

- name: Create issue
id: create_issue
uses: epsylabs/action-find-linear-issue@main
with:
linear-api-key: ${{secrets.LINEAR_API_KEY}}
scope: issue
resource: "${{ fromJson(steps.linear_info.outputs.linear-issue).project.id }}"
name: "Test results report"
target: https://example.com

- name: Create comment in PR with Linear Issue link
uses: peter-evans/create-or-update-comment@v2
env:
issue_identifier: ${{ fromJson(steps.findIssue.outputs.linear-issue).identifier }}
issue_title: ${{ fromJson(steps.findIssue.outputs.linear-issue).title }}
issue_url: ${{ fromJson(steps.findIssue.outputs.linear-issue).url }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
[${{ env.issue_identifier }}: ${{ env.issue_title }}](${{ env.issue_url }})
```

0 comments on commit 1253ada

Please sign in to comment.