Skip to content

Commit 6ad3303

Browse files
committed
Convert to typescript
1 parent 299e423 commit 6ad3303

36 files changed

+15469
-5042
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.eslintrc.json

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
{
2-
"env": {
3-
"commonjs": true,
4-
"es6": true,
5-
"node": true
6-
},
7-
"extends": "eslint:recommended",
8-
"globals": {
9-
"Atomics": "readonly",
10-
"SharedArrayBuffer": "readonly"
11-
},
12-
"parserOptions": {
13-
"ecmaVersion": 2018
14-
},
15-
"rules": {
16-
}
17-
}
2+
"env": { "node": true, "jest": true },
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": { "ecmaVersion": 9, "sourceType": "module" },
5+
"extends": [
6+
"eslint:recommended",
7+
"plugin:@typescript-eslint/eslint-recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:import/errors",
10+
"plugin:import/warnings",
11+
"plugin:import/typescript",
12+
"plugin:prettier/recommended"
13+
],
14+
"plugins": ["@typescript-eslint"],
15+
"rules": {
16+
"@typescript-eslint/camelcase": "off"
17+
}
18+
}

.github/workflows/ci.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ jobs:
2222
with:
2323
python-version: '3.x'
2424
- run: npm ci
25-
- run: npm run clean
25+
- run: npm run build
26+
- run: npm run format-check
27+
- run: npm run lint
2628
- run: npm run test
27-
- run: npm run package
2829
- uses: actions/upload-artifact@v2
2930
with:
3031
name: dist
@@ -60,7 +61,9 @@ jobs:
6061
with:
6162
title: '[CI] test ${{ matrix.target }}'
6263
content-filepath: ./example-content/output.md
63-
labels: report, automated issue
64+
labels: |
65+
report
66+
automated issue
6467
assignees: peter-evans
6568

6669
- name: Test update issue from file
@@ -69,7 +72,9 @@ jobs:
6972
issue-number: ${{ steps.ciff.outputs.issue-number }}
7073
title: '[CI] test ${{ matrix.target }}'
7174
content-filepath: ./example-content/output.md
72-
labels: report, automated issue
75+
labels: |
76+
report
77+
automated issue
7378
assignees: peter-evans
7479

7580
- name: Close Issue

.github/workflows/ciff-example-command.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
with:
3131
title: An example issue
3232
content-filepath: ./example-content/output.md
33-
labels: report, automated issue
33+
labels: |
34+
report
35+
automated issue
3436
assignees: peter-evans
3537

3638
# Test update
@@ -40,7 +42,9 @@ jobs:
4042
issue-number: ${{ steps.ciff.outputs.issue-number }}
4143
title: An example issue
4244
content-filepath: ./example-content/output.md
43-
labels: report, automated issue
45+
labels: |
46+
report
47+
automated issue
4448
assignees: peter-evans
4549

4650
- name: Add reaction

.gitignore

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
__pycache__
2-
.python-version
3-
4-
node_modules
5-
6-
.DS_Store
1+
lib/
2+
node_modules/

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.prettierrc.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": false,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": false,
9+
"arrowParens": "avoid",
10+
"parser": "typescript"
11+
}

README.md

+15-12
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@ If the file does not exist the action exits silently.
1414

1515
```yml
1616
- name: Create Issue From File
17-
uses: peter-evans/create-issue-from-file@v2
17+
uses: peter-evans/create-issue-from-file@v3
1818
with:
1919
title: An example issue
2020
content-filepath: ./example-content/output.md
21-
labels: report, automated issue
21+
labels: |
22+
report
23+
automated issue
2224
```
2325
24-
### Inputs
25-
26-
- `token` - `GITHUB_TOKEN` or a `repo` scoped [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). Defaults to `GITHUB_TOKEN`.
27-
- `issue-number` - The issue number of an existing issue to update
28-
- `title` (**required**) - The title of the issue
29-
- `content-filepath` (**required**) - The file path to the issue content
30-
- `labels` - A comma separated list of labels
31-
- `assignees` - A comma separated list of assignees (GitHub usernames)
32-
- `project` - *Deprecated*. See [Create a project card](#create-a-project-card) for details.
33-
- `project-column` - *Deprecated*. See [Create a project card](#create-a-project-card) for details.
26+
### Action inputs
27+
28+
| Name | Description | Default |
29+
| --- | --- | --- |
30+
| `token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). | `GITHUB_TOKEN` |
31+
| `repository` | The target GitHub repository. | Current repository |
32+
| `issue-number` | The issue number of an existing issue to update. | |
33+
| `title` | (**required**) The title of the issue. | |
34+
| `content-filepath` | The file path to the issue content. | |
35+
| `labels` | A comma or newline-separated list of labels. | |
36+
| `assignees` | A comma or newline-separated list of assignees (GitHub usernames). | |
3437

3538
### Outputs
3639

action.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,26 @@ inputs:
44
token:
55
description: 'The GitHub authentication token'
66
default: ${{ github.token }}
7+
repository:
8+
description: 'The target GitHub repository'
9+
default: ${{ github.repository }}
710
issue-number:
811
description: 'The issue number of an existing issue to update'
912
title:
10-
description: 'The title of the issue.'
13+
description: 'The title of the issue'
1114
required: true
1215
content-filepath:
13-
description: 'The file path to the issue content.'
16+
description: 'The file path to the issue content'
1417
labels:
15-
description: 'A comma separated list of labels.'
18+
description: 'A comma or newline-separated list of labels'
1619
assignees:
17-
description: 'A comma separated list of assignees (GitHub usernames).'
18-
project:
19-
description: 'Deprecated. See README for details.'
20-
project-column:
21-
description: 'Deprecated. See README for details.'
20+
description: 'A comma or newline-separated list of assignees (GitHub usernames)'
2221
outputs:
2322
issue-number:
24-
description: 'The number of the created issue.'
23+
description: 'The number of the created issue'
2524
runs:
2625
using: 'node12'
2726
main: 'dist/index.js'
2827
branding:
29-
icon: 'alert-circle'
28+
icon: 'alert-circle'
3029
color: 'orange'

dist/ciff/create_issue_from_file.py

-109
This file was deleted.

dist/ciff/requirements.txt

-3
This file was deleted.

0 commit comments

Comments
 (0)