V3 preview (#53)

* Covert to use ncc, publish under name Labeler

* Get the filename right
This commit is contained in:
David Kale
2020-03-05 12:57:26 -05:00
committed by GitHub
parent 58187b6094
commit d2c408e7ed
11 changed files with 31673 additions and 1340 deletions

View File

@@ -1,4 +1,4 @@
name: 'Pull Request Labeler' name: 'Labeler'
description: 'Add labels to new pull requests based on the files that are changed' description: 'Add labels to new pull requests based on the files that are changed'
author: 'GitHub' author: 'GitHub'
inputs: inputs:
@@ -9,4 +9,4 @@ inputs:
default: '.github/labeler.yml' default: '.github/labeler.yml'
runs: runs:
using: 'node12' using: 'node12'
main: 'lib/main.js' main: 'dist/index.js'

30717
dist/index.js vendored Normal file

File diff suppressed because it is too large Load Diff

2257
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,10 @@
{ {
"name": "labeler", "name": "labeler",
"version": "2.0.0", "version": "3.0.0",
"private": true,
"description": "Labels pull requests by files altered", "description": "Labels pull requests by files altered",
"main": "lib/main.js", "main": "dist/index.js",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc && ncc build",
"format": "prettier --write **/*.ts", "format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts", "format-check": "prettier --check **/*.ts",
"test": "jest" "test": "jest"
@@ -15,15 +14,16 @@
"url": "git+https://github.com/actions/labeler.git" "url": "git+https://github.com/actions/labeler.git"
}, },
"keywords": [ "keywords": [
"github",
"actions", "actions",
"node", "label",
"setup" "labeler"
], ],
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.0.0", "@actions/core": "^1.0.0",
"@actions/github": "^1.0.0", "@actions/github": "^2.1.1",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"semver": "^6.1.1" "semver": "^6.1.1"
@@ -34,18 +34,11 @@
"@types/semver": "^6.0.0", "@types/semver": "^6.0.0",
"@types/minimatch": "^3.0.0", "@types/minimatch": "^3.0.0",
"@types/js-yaml": "^3.12.1", "@types/js-yaml": "^3.12.1",
"husky": "^2.3.0", "@zeit/ncc": "^0.21.1",
"jest": "^24.8.0", "jest": "^24.8.0",
"jest-circus": "^24.7.1", "jest-circus": "^24.7.1",
"prettier": "^1.17.1", "prettier": "^1.17.1",
"ts-jest": "^24.0.2", "ts-jest": "^24.0.2",
"typescript": "^3.5.1" "typescript": "^3.5.1"
},
"husky": {
"skipCI": true,
"hooks": {
"pre-commit": "npm run build && npm run format",
"post-commit": "npm prune --production && git add node_modules/* && git commit -m \"Husky commit correct node modules\""
}
} }
} }

View File

@@ -89,14 +89,14 @@ async function fetchContent(
client: github.GitHub, client: github.GitHub,
repoPath: string repoPath: string
): Promise<string> { ): Promise<string> {
const response = await client.repos.getContents({ const response: any = await client.repos.getContents({
owner: github.context.repo.owner, owner: github.context.repo.owner,
repo: github.context.repo.repo, repo: github.context.repo.repo,
path: repoPath, path: repoPath,
ref: github.context.sha ref: github.context.sha
}); });
return Buffer.from(response.data.content, 'base64').toString(); return Buffer.from(response.data.content, response.data.encoding).toString();
} }
function getLabelGlobMapFromObject(configObject: any): Map<string, string[]> { function getLabelGlobMapFromObject(configObject: any): Map<string, string[]> {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -11,7 +11,7 @@
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */ // "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./lib", /* Redirect output structure to the directory. */ "outDir": "./dist", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */ // "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */