Skip to content

Commit 3383acd

Browse files
authored
v3 (#161)
* typescript * fix reactions input * test comma separated * bump version * append-separator * refactor * refactor reactions * get reactions * handle default token * return reaction id * remove reactions * reactions-edit-mode * readme * test-command * fix step order * deprecate body-file * update ci to body-path
1 parent 9c63576 commit 3383acd

21 files changed

+3654
-5531
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.eslintrc.json

Lines changed: 17 additions & 16 deletions
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/comment-body-addition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
**Edit:** Some additional info
1+
This is still the second line.

.github/comment-body.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
This is a multi-line test comment read from a file.
2-
- With GitHub **Markdown** :sparkles:
3-
- Created by [create-or-update-comment][1]
4-
5-
[1]: https://github.com/peter-evans/create-or-update-comment
2+
This is the second line.

.github/workflows/ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
node-version: 16.x
2929
cache: npm
3030
- run: npm ci
31+
- run: npm run build
32+
- run: npm run format-check
33+
- run: npm run lint
3134
- run: npm run test
32-
- run: npm run package
3335
- uses: actions/upload-artifact@v3
3436
with:
3537
name: dist
@@ -86,27 +88,34 @@ jobs:
8688
body: |
8789
**Edit:** Some additional info
8890
reactions: eyes
91+
reactions-edit-mode: replace
8992

9093
- name: Test add reactions
9194
uses: ./
9295
with:
9396
comment-id: ${{ steps.couc.outputs.comment-id }}
94-
reactions: heart, hooray, laugh
97+
reactions: |
98+
heart
99+
hooray
100+
laugh
95101
96102
- name: Test create comment from file
97103
uses: ./
98104
id: couc2
99105
with:
100106
issue-number: ${{ needs.build.outputs.issue-number }}
101-
body-file: .github/comment-body.md
102-
reactions: '+1'
107+
body-path: .github/comment-body.md
108+
reactions: |
109+
+1
103110
104111
- name: Test update comment from file
105112
uses: ./
106113
with:
107114
comment-id: ${{ steps.couc2.outputs.comment-id }}
108-
body-file: .github/comment-body-addition.md
109-
reactions: eyes
115+
body-path: .github/comment-body-addition.md
116+
append-separator: space
117+
reactions: eyes, rocket
118+
reactions-edit-mode: replace
110119

111120
package:
112121
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

.github/workflows/test-command.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
body: |
4646
**Edit:** Some additional info
4747
reactions: eyes
48+
reactions-edit-mode: replace
4849

4950
# Test add reactions
5051
- name: Add reactions
@@ -53,19 +54,12 @@ jobs:
5354
comment-id: ${{ steps.couc.outputs.comment-id }}
5455
reactions: heart, hooray, laugh
5556

56-
- name: Add reaction
57-
uses: peter-evans/create-or-update-comment@v2
58-
with:
59-
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
60-
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
61-
reactions: hooray
62-
6357
# Test create with body from file
6458
- name: Create comment
6559
uses: ./
6660
with:
6761
issue-number: 1
68-
body-file: .github/comment-body.md
62+
body-path: .github/comment-body.md
6963

7064
# Test create from template
7165
- name: Render template
@@ -82,3 +76,10 @@ jobs:
8276
with:
8377
issue-number: 1
8478
body: ${{ steps.template.outputs.result }}
79+
80+
- name: Add reaction
81+
uses: peter-evans/create-or-update-comment@v2
82+
with:
83+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
84+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
85+
reactions: hooray

.github/workflows/update-major-version.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
description: The major version tag to update
1313
options:
1414
- v2
15+
- v3
1516

1617
jobs:
1718
tag:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
lib/
2+
node_modules/

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.prettierrc.json

Lines changed: 11 additions & 0 deletions
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+
}

0 commit comments

Comments
 (0)