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'
author: 'GitHub'
inputs:
@@ -9,4 +9,4 @@ inputs:
default: '.github/labeler.yml'
runs:
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

2263
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,10 @@
{
"name": "labeler",
"version": "2.0.0",
"private": true,
"version": "3.0.0",
"description": "Labels pull requests by files altered",
"main": "lib/main.js",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"build": "tsc && ncc build",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"test": "jest"
@@ -15,15 +14,16 @@
"url": "git+https://github.com/actions/labeler.git"
},
"keywords": [
"github",
"actions",
"node",
"setup"
"label",
"labeler"
],
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.0.0",
"@actions/github": "^1.0.0",
"@actions/github": "^2.1.1",
"js-yaml": "^3.13.1",
"minimatch": "^3.0.4",
"semver": "^6.1.1"
@@ -34,18 +34,11 @@
"@types/semver": "^6.0.0",
"@types/minimatch": "^3.0.0",
"@types/js-yaml": "^3.12.1",
"husky": "^2.3.0",
"@zeit/ncc": "^0.21.1",
"jest": "^24.8.0",
"jest-circus": "^24.7.1",
"prettier": "^1.17.1",
"ts-jest": "^24.0.2",
"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,
repoPath: string
): Promise<string> {
const response = await client.repos.getContents({
const response: any = await client.repos.getContents({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
path: repoPath,
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[]> {

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. */
// "sourceMap": true, /* Generates corresponding '.map' 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. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */