Skip to content

Commit 94de873

Browse files
authored
Add project node to output results (#2)
1 parent 9236196 commit 94de873

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This is helpful when you're:
1919
| `include-branch-name` | Taking the PR branch name into account to find issues (default `true`) | 🚫 |
2020
| `with-team` | Include `team` node into each resulted `issue` (default `true`) | 🚫 |
2121
| `with-labels` | Include `labels` nodes into each resulted `issue` (default `true`) | 🚫 |
22+
| `with-project` | Include `project` node into each resulted `issue` (default `true`) | 🚫 |
2223

2324
## Outputs
2425

@@ -47,7 +48,7 @@ jobs:
4748
steps:
4849
- name: Find the Linear Issue
4950
id: findIssue
50-
uses: nrpx/action-find-linear-issue@v1
51+
uses: nrpx/action-find-linear-issue@v1.3
5152
with:
5253
linear-api-key: ${{secrets.LINEAR_API_KEY}}
5354

action.yml

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ inputs:
2222
with-labels:
2323
description: "Include `labels` nodes into each resulted `issue` (default `true`)"
2424
required: false
25+
with-project:
26+
description: "Include `project` node into each resulted `issue` (default `true`)"
27+
required: false
2528

2629
outputs:
2730
linear-issues:

dist/index.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "action-find-linear-issue",
3-
"version": "0.1",
4-
"description": "",
3+
"version": "1.3",
4+
"description": "Finds a Linear Issue from your pull request's branch, title, or description",
55
"main": "src/main.ts",
66
"private": true,
77
"scripts": {

src/main.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
IssueLabel,
55
LinearClient,
66
LinearClientOptions,
7+
Project,
78
Team,
89
} from "@linear/sdk";
910
import { context } from "@actions/github";
@@ -18,6 +19,7 @@ type InputMap = {
1819
includeBranchName: boolean;
1920
withTeam: boolean;
2021
withLabels: boolean;
22+
withProject: boolean;
2123
};
2224

2325
type ApiKeyInput = Pick<LinearClientOptions, "apiKey">;
@@ -27,10 +29,11 @@ type PartsWithOpts<Type> = {
2729
};
2830
type PartsType = PartsWithOpts<{ branch: void; title: void; body: void }>;
2931

30-
type LimitedIssue = Omit<Issue, "team" | "labels">;
32+
type LimitedIssue = Omit<Issue, "team" | "labels" | "project">;
3133
type FoundIssueType = LimitedIssue & {
3234
team?: Team | null;
3335
labels?: IssueLabel[] | null;
36+
project?: Project | null;
3437
};
3538

3639
const main = async () => {
@@ -52,6 +55,7 @@ const main = async () => {
5255
includeBranchName: boolCheck(getInput("include-branch-name"), true),
5356
withTeam: boolCheck(getInput("with-team"), true),
5457
withLabels: boolCheck(getInput("with-labels"), true),
58+
withProject: boolCheck(getInput("with-project"), true),
5559
};
5660

5761
const prParts: PartsType = {
@@ -118,6 +122,7 @@ const main = async () => {
118122
...(issue as LimitedIssue),
119123
team: inputs.withTeam ? await issue.team : null,
120124
labels: inputs.withLabels ? (await issue.labels()).nodes : null,
125+
project: inputs.withProject ? await issue.project : null,
121126
};
122127
}
123128
);

0 commit comments

Comments
 (0)