Skip to content

Commit

Permalink
TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEtco committed May 14, 2020
1 parent a131c8b commit 60b6e2d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 9 deletions.
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "build-and-tag-action",
"private": true,
"main": "index.js",
"main": "src/index.ts",
"scripts": {
"start": "node ./index.js",
"start": "npx ncc run ./src/index.ts",
"build": "npx ncc build ./src/index.ts",
"dev": "GITHUB_EVENT_PATH=$(pwd)/tests/fixtures/sponsor.json npm start",
"test": "standard && jest --coverage"
},
Expand All @@ -12,10 +13,14 @@
"semver": "^7.3.2"
},
"devDependencies": {
"@tsconfig/node12": "^1.0.0",
"@types/semver": "^7.2.0",
"@zeit/ncc": "^0.22.1",
"jest": "^26.0.1",
"js-yaml": "^3.13.1",
"nock": "^12.0.2",
"standard": "^14.3.1"
"standard": "^14.3.1",
"typescript": "^3.9.2"
},
"standard": {
"env": [
Expand Down
12 changes: 6 additions & 6 deletions index.js → src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs')
const path = require('path')
const { Toolkit } = require('actions-toolkit')
const semver = require('semver')
import fs from 'fs'
import path from 'path'
import { Toolkit } from 'actions-toolkit'
import semver from 'semver'

Toolkit.run(async tools => {
const { main } = tools.getPackageJSON()
Expand All @@ -20,14 +20,14 @@ Toolkit.run(async tools => {
mode: '100644',
type: 'blob',
content: actionYaml,
base_tree: tools.context.sha
sha: tools.context.sha
},
{
path: main,
mode: '100644',
type: 'blob',
content: code,
base_tree: tools.context.sha
sha: tools.context.sha
}
]
})
Expand Down
6 changes: 6 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@tsconfig/node12/tsconfig.json",
"compilerOptions": {
"esModuleInterop": true
}
}

0 comments on commit 60b6e2d

Please sign in to comment.