Skip to content

Commit

Permalink
Merge pull request #420 from peter-evans/typescript
Browse files Browse the repository at this point in the history
Convert to typescript
  • Loading branch information
peter-evans authored Apr 14, 2021
2 parents 299e423 + 6ad3303 commit 7c7c136
Show file tree
Hide file tree
Showing 36 changed files with 15,469 additions and 5,042 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
33 changes: 17 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
}
"env": { "node": true, "jest": true },
"parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 9, "sourceType": "module" },
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/camelcase": "off"
}
}
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
with:
python-version: '3.x'
- run: npm ci
- run: npm run clean
- run: npm run build
- run: npm run format-check
- run: npm run lint
- run: npm run test
- run: npm run package
- uses: actions/upload-artifact@v2
with:
name: dist
Expand Down Expand Up @@ -60,7 +61,9 @@ jobs:
with:
title: '[CI] test ${{ matrix.target }}'
content-filepath: ./example-content/output.md
labels: report, automated issue
labels: |
report
automated issue
assignees: peter-evans

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

- name: Close Issue
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ciff-example-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
with:
title: An example issue
content-filepath: ./example-content/output.md
labels: report, automated issue
labels: |
report
automated issue
assignees: peter-evans

# Test update
Expand All @@ -40,7 +42,9 @@ jobs:
issue-number: ${{ steps.ciff.outputs.issue-number }}
title: An example issue
content-filepath: ./example-content/output.md
labels: report, automated issue
labels: |
report
automated issue
assignees: peter-evans

- name: Add reaction
Expand Down
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
__pycache__
.python-version

node_modules

.DS_Store
lib/
node_modules/
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,26 @@ If the file does not exist the action exits silently.

```yml
- name: Create Issue From File
uses: peter-evans/create-issue-from-file@v2
uses: peter-evans/create-issue-from-file@v3
with:
title: An example issue
content-filepath: ./example-content/output.md
labels: report, automated issue
labels: |
report
automated issue
```
### Inputs
- `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`.
- `issue-number` - The issue number of an existing issue to update
- `title` (**required**) - The title of the issue
- `content-filepath` (**required**) - The file path to the issue content
- `labels` - A comma separated list of labels
- `assignees` - A comma separated list of assignees (GitHub usernames)
- `project` - *Deprecated*. See [Create a project card](#create-a-project-card) for details.
- `project-column` - *Deprecated*. See [Create a project card](#create-a-project-card) for details.
### Action inputs
| Name | Description | Default |
| --- | --- | --- |
| `token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). | `GITHUB_TOKEN` |
| `repository` | The target GitHub repository. | Current repository |
| `issue-number` | The issue number of an existing issue to update. | |
| `title` | (**required**) The title of the issue. | |
| `content-filepath` | The file path to the issue content. | |
| `labels` | A comma or newline-separated list of labels. | |
| `assignees` | A comma or newline-separated list of assignees (GitHub usernames). | |

### Outputs

Expand Down
19 changes: 9 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@ inputs:
token:
description: 'The GitHub authentication token'
default: ${{ github.token }}
repository:
description: 'The target GitHub repository'
default: ${{ github.repository }}
issue-number:
description: 'The issue number of an existing issue to update'
title:
description: 'The title of the issue.'
description: 'The title of the issue'
required: true
content-filepath:
description: 'The file path to the issue content.'
description: 'The file path to the issue content'
labels:
description: 'A comma separated list of labels.'
description: 'A comma or newline-separated list of labels'
assignees:
description: 'A comma separated list of assignees (GitHub usernames).'
project:
description: 'Deprecated. See README for details.'
project-column:
description: 'Deprecated. See README for details.'
description: 'A comma or newline-separated list of assignees (GitHub usernames)'
outputs:
issue-number:
description: 'The number of the created issue.'
description: 'The number of the created issue'
runs:
using: 'node12'
main: 'dist/index.js'
branding:
icon: 'alert-circle'
icon: 'alert-circle'
color: 'orange'
109 changes: 0 additions & 109 deletions dist/ciff/create_issue_from_file.py

This file was deleted.

3 changes: 0 additions & 3 deletions dist/ciff/requirements.txt

This file was deleted.

Loading

0 comments on commit 7c7c136

Please sign in to comment.