diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8813623..9083830 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,35 +1,24 @@
## 1.0.45 (2022-01-17)
-* build(deps): bump shelljs from 0.8.4 to 0.8.5 ([1da350a](https://github.com/simonecorsi/mawesome/commit/1da350a))
-
-
+- build(deps): bump shelljs from 0.8.4 to 0.8.5 ([1da350a](https://github.com/simonecorsi/mawesome/commit/1da350a))
## 1.0.44 (2021-10-26)
-* chore(release): v1.0.44 ([6ffe17f](https://github.com/simonecorsi/mawesome/commit/6ffe17f))
-* feat: git add multiple files at once ([4aef61f](https://github.com/simonecorsi/mawesome/commit/4aef61f))
-
-
+- chore(release): v1.0.44 ([6ffe17f](https://github.com/simonecorsi/mawesome/commit/6ffe17f))
+- feat: git add multiple files at once ([4aef61f](https://github.com/simonecorsi/mawesome/commit/4aef61f))
## 1.0.43 (2021-10-15)
-* chore(release): v1.0.43 ([5e0ef82](https://github.com/simonecorsi/mawesome/commit/5e0ef82))
-* feat: reduce json output size ([94635fe](https://github.com/simonecorsi/mawesome/commit/94635fe))
-
-
+- chore(release): v1.0.43 ([5e0ef82](https://github.com/simonecorsi/mawesome/commit/5e0ef82))
+- feat: reduce json output size ([94635fe](https://github.com/simonecorsi/mawesome/commit/94635fe))
## 1.0.42 (2021-10-14)
-* chore(release): v1.0.42 ([5b36813](https://github.com/simonecorsi/mawesome/commit/5b36813))
-* fix(paginator): last page now correctly matches rex ([dcf9898](https://github.com/simonecorsi/mawesome/commit/dcf9898))
-
-
+- chore(release): v1.0.42 ([5b36813](https://github.com/simonecorsi/mawesome/commit/5b36813))
+- fix(paginator): last page now correctly matches rex ([dcf9898](https://github.com/simonecorsi/mawesome/commit/dcf9898))
## 1.0.41 (2021-10-14)
-* chore(release): v1.0.41 ([884fc90](https://github.com/simonecorsi/mawesome/commit/884fc90))
-* test: fixs suite ([b97833f](https://github.com/simonecorsi/mawesome/commit/b97833f))
-* fix: should avoid index lock ([1d6848c](https://github.com/simonecorsi/mawesome/commit/1d6848c))
-
-
-
+- chore(release): v1.0.41 ([884fc90](https://github.com/simonecorsi/mawesome/commit/884fc90))
+- test: fixs suite ([b97833f](https://github.com/simonecorsi/mawesome/commit/b97833f))
+- fix: should avoid index lock ([1d6848c](https://github.com/simonecorsi/mawesome/commit/1d6848c))
diff --git a/package-lock.json b/package-lock.json
index 03ddf34..c5ef838 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "mawesome",
- "version": "1.0.45",
+ "version": "1.1.0-next.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "mawesome",
- "version": "1.0.45",
+ "version": "1.1.0-next.1",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
diff --git a/src/index.ts b/src/index.ts
index abc0552..ac01c45 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,4 +1,5 @@
import * as core from '@actions/core';
+import { readdir, readFile } from 'fs/promises';
import {
renderer,
@@ -27,11 +28,25 @@ export async function main(): Promise {
{}
);
- const rendered = await renderer({
- username: REPO_USERNAME,
- stars: Object.entries(sortedByLanguages),
- updatedAt: Date.now(),
- });
+ // get template if found in the repo
+ let template;
+ try {
+ const dir = await readdir('./');
+ core.info(dir.join('\n'));
+ template = await readFile('TEMPLATE.ejs', 'utf8');
+ core.info(template);
+ } catch {
+ core.warning("Couldn't find template file, using default");
+ }
+
+ const rendered = await renderer(
+ {
+ username: REPO_USERNAME,
+ stars: Object.entries(sortedByLanguages),
+ updatedAt: Date.now(),
+ },
+ template
+ );
const markdown: string = await generateMd(rendered);