Skip to content

Commit

Permalink
Fix pre commit failing on modified ts code (#4)
Browse files Browse the repository at this point in the history
* The npm release step will not add generated files automaticaly

Previously the release step was adding the generated dist
files to git automatically, which was not a good idea because
pre-commit did not fail in case someone modified the .ts file

Now the pre-commit check for npm will behave like all other
pre-commit checks - if a file will be modified by the check,
the file will not be added and pre-commit check will fail
allowing the author to add the file manually.
  • Loading branch information
potiuk authored Aug 29, 2020
1 parent f054515 commit f6b43a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
const github = __importStar(__webpack_require__(469));
const core = __importStar(__webpack_require__(393));
const treemap = __importStar(__webpack_require__(706));
const CANCELLABLE_RUNS = ['push', 'pull_request', 'workflow_run', 'schedule', 'workflow_dispatch'];
const CANCELLABLE_RUNS = [
'push',
'pull_request',
'workflow_run',
'schedule',
'workflow_dispatch'
];
var CancelMode;
(function (CancelMode) {
CancelMode["DUPLICATES"] = "duplicates";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"pack": "ncc build",
"test": "jest",
"all": "npm run build && npm run format && npm run lint && npm run pack && npm test",
"release": "ncc build -o dist src/main.ts && git add -f dist/"
"release": "ncc build -o dist src/main.ts"
},
"repository": {
"type": "git",
Expand Down
8 changes: 7 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import * as core from '@actions/core'
import * as rest from '@octokit/rest'
import * as treemap from 'jstreemap'

const CANCELLABLE_RUNS = ['push', 'pull_request', 'workflow_run', 'schedule', 'workflow_dispatch']
const CANCELLABLE_RUNS = [
'push',
'pull_request',
'workflow_run',
'schedule',
'workflow_dispatch'
]

enum CancelMode {
DUPLICATES = 'duplicates',
Expand Down

0 comments on commit f6b43a6

Please sign in to comment.