Skip to content

Commit 5726004

Browse files
publish to dev.to
1 parent 95620eb commit 5726004

File tree

12 files changed

+289
-202
lines changed

12 files changed

+289
-202
lines changed

.eslintrc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
"@typescript-eslint/promise-function-async": "error",
4242
"@typescript-eslint/require-array-sort-compare": "error",
4343
"@typescript-eslint/restrict-plus-operands": "error",
44-
"semi": "off",
45-
"@typescript-eslint/semi": ["error", "never"],
4644
"@typescript-eslint/type-annotation-spacing": "error",
4745
"@typescript-eslint/unbound-method": "error"
4846
},
@@ -51,4 +49,4 @@
5149
"es6": true,
5250
"jest/globals": true
5351
}
54-
}
52+
}

.prettierrc.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"printWidth": 80,
2+
"printWidth": 120,
33
"tabWidth": 2,
44
"useTabs": false,
5-
"semi": false,
5+
"semi": true,
66
"singleQuote": true,
7-
"trailingComma": "none",
7+
"trailingComma": "es5",
88
"bracketSpacing": false,
9-
"arrowParens": "avoid"
9+
"arrowParens": "always"
1010
}

dist/index.js

Lines changed: 179 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 24 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
"@actions/core": "^1.2.6",
2929
"@actions/github": "^4.0.0",
3030
"@github-docs/frontmatter": "^1.3.1",
31-
"@octokit/webhooks": "^7.21.0"
31+
"@octokit/webhooks": "^7.21.0",
32+
"@types/node-fetch": "^2.5.7",
33+
"node-fetch": "^2.6.1"
3234
},
3335
"devDependencies": {
3436
"@types/jest": "^26.0.15",

src/get-files.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as core from '@actions/core';
2+
import * as github from '@actions/github';
3+
4+
export const getFiles = async (): Promise<string[]> => {
5+
const octokit = github.getOctokit(core.getInput('github-token'));
6+
const commit = await octokit.repos.getCommit({
7+
...github.context.repo,
8+
ref: github.context.sha,
9+
});
10+
11+
return (commit?.data?.files || [])
12+
.map((file: any) => file.filename)
13+
.filter((filename: string) => filename.includes(core.getInput('content-dir')));
14+
};

0 commit comments

Comments
 (0)