8000 octokit mail · avdim/github-script@5faf793 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5faf793

Browse files
committed
octokit mail
1 parent 561c7d4 commit 5faf793

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
# charset = utf-8
5+
# end_of_line = lf
6+
indent_size = 2
7+
# indent_style = space
8+
# insert_final_newline = false
9+
max_line_length = 140
10+
# tab_width = 4
11+
# ij_continuation_indent_size = 8
12+
# ij_formatter_off_tag = @formatter:off
13+
# ij_formatter_on_tag = @formatter:on
14+
# ij_formatter_tags_enabled = false
15+
# ij_smart_tabs = false
16+
# ij_wrap_on_typing = false
17+

__test__/octokit.test.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22

3-
import {callAsyncFunction} from '../src/async-function'
4-
import {getOctokit} from "@actions/github";
5-
import * as fs from "fs";
3+
import {getOctokit} from '@actions/github'
4+
import * as fs from 'fs'
5+
import {Octokit} from '@octokit/core'
66

77
describe('octokit tests', () => {
8-
test('octoki1', async () => {
9-
let content = fs.readFileSync('token.txt','utf8');
10-
console.log("token.txt content:", content)
11-
// getOctokit()
12-
// await callAsyncFunction({} as any, 'console')
8+
test('mail', async () => {
9+
let tokenStr: 8000 string = fs.readFileSync('token.txt', 'utf8')
10+
console.log('token.txt content:', tokenStr)
11+
let octokit: Octokit = getOctokit(tokenStr)
12+
let mailResponse = await octokit.request('GET /user/emails')
13+
console.log('first mail: ', mailResponse.data[0].email)
14+
expect(mailResponse.data[0].email).toEqual('avdim@mail.ru')
1315
})
1416
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"pre-commit": "run-s style:write test build",
1717
"test": "jest"
1818
},
19-
"husky": {
19+
"huskyOLD": {
2020
"hooks": {
2121
"pre-commit": "npm run pre-commit && git add dist/"
2222
}

0 commit comments

Comments
 (0)
0