Skip to content

Commit

Permalink
setup lint
Browse files Browse the repository at this point in the history
  • Loading branch information
undefined committed May 8, 2020
1 parent 6e7b6a0 commit 92339a1
Show file tree
Hide file tree
Showing 11 changed files with 936 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
tmp*/
node_modules/
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
extends: ["prettier"],
plugins: ["prettier"],
rules: {
"prettier/prettier": ["error"],
"sort-keys": ["error"],
},
parserOptions: {
ecmaVersion: 2017,
},
env: {
es6: true,
},
};
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Fix end-of-lines in Git versions older than 2.10
# https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dependency directory
node_modules
lib/
tmp*

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist/
lib/
tmp*/
node_modules/
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"editor.formatOnSave": true
}
"editor.formatOnSave": true
}
27 changes: 13 additions & 14 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ module.exports =
/***/ (function() {

Object.entries({
DRY_RUN: "true",
FILE_PATTERNS: `.github/workflows/synced-.*`,
PERSONAL_TOKEN: "ee7d80aa7a551f2acaee79ef70b48431c2266821",
SKIP_CLEANUP: "true",
SRC_REPO: "adrianjost/.github",
TARGET_REPOS: "adrianjost/files-sync-target",
DRY_RUN: "true",
SKIP_CLEANUP: "true",
TEMP_DIR: "temporaer",
FILE_PATTERNS: `
.github/workflows/synced-.*`,
}).forEach(([key, value]) => {
process.env[`INPUT_${key}`] = value;
});
Expand Down Expand Up @@ -3410,19 +3409,25 @@ const trimArray = (arr) => {
};

module.exports = {
FILE_PATTERNS: trimArray(core.getInput("FILE_PATTERNS").split("\n")).map(
(s) => new RegExp(s)
),
get COMMIT_MESSAGE() {
return `Update file(s) from \"${this.SRC_REPO}\"`;
},
DRY_RUN: ["1", "true"].includes(
core.getInput("DRY_RUN", { required: false }).toLowerCase()
),
FILE_PATTERNS: trimArray(core.getInput("FILE_PATTERNS").split("\n")).map(
(s) => new RegExp(s)
),
GIT_EMAIL:
core.getInput("GIT_EMAIL") ||
`${process.env.GITHUB_ACTOR}@users.noreply.github.com`,
GIT_PERSONAL_TOKEN: core.getInput("PERSONAL_TOKEN", { required: true }),
GIT_USERNAME:
core.getInput("GIT_USERNAME", { required: false }) ||
process.env.GITHUB_ACTOR,
SKIP_CLEANUP: ["1", "true"].includes(
core.getInput("SKIP_CLEANUP", { required: false }).toLowerCase()
),
SRC_REPO:
core.getInput("SRC_REPO", { required: false }) ||
process.env.GITHUB_REPOSITORY,
Expand All @@ -3432,12 +3437,6 @@ module.exports = {
TMPDIR:
core.getInput("TEMP_DIR", { required: false }) ||
`tmp-${Date.now().toString()}`,
DRY_RUN: ["1", "true"].includes(
core.getInput("DRY_RUN", { required: false }).toLowerCase()
),
SKIP_CLEANUP: ["1", "true"].includes(
core.getInput("SKIP_CLEANUP", { required: false }).toLowerCase()
),
};


Expand Down Expand Up @@ -3749,8 +3748,8 @@ module.exports = {
getFiles,
getRepoPath,
getRepoRelativeFilePath,
removeFiles,
removeDir,
removeFiles,
};


Expand Down
Loading

0 comments on commit 92339a1

Please sign in to comment.