Skip to content

Commit a7ccb07

Browse files
authored
dev: allow no ignore (#264)
changelog: * dev: allow no ignore * chore: a boost to v1
1 parent 7babc09 commit a7ccb07

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Add the following code into your workflow:
1616

1717
```yml
1818
- name: Readable Readme
19-
uses: tianhaoz95/readable-readme@v0.2.0-alpha
19+
uses: tianhaoz95/readable-readme@v1.0.0-alpha
2020
with:
2121
token: ${{ secrets.TEST_GITHUB_TOKEN }}
2222
```

src/util.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,15 @@ export function rrlog(logMsg: string): void {
276276
*/
277277
export function getReadmeIgnoreList(filename: string): string[] {
278278
// TODO(tianhaoz95): add test for this.
279-
const ignoreContent: string = readFileContent(filename);
280-
const ignoreList: string[] = ignoreContent.split("\n");
279+
let ignoreContent: string = "";
280+
let ignoreList: string[] = [];
281+
try {
282+
ignoreContent = readFileContent(filename);
283+
ignoreList = ignoreContent.split("\n");
284+
} catch (err) {
285+
rrlog("Ignore file not found");
286+
ignoreList = [];
287+
}
281288
const sanitizedIgnoreList: string[] = [];
282289
for (const ignoreEntry of ignoreList) {
283290
if (ignoreEntry.length > 0) {

0 commit comments

Comments
 (0)