Skip to content

Commit c7f006f

Browse files
committed
feat(generators): dotgithub repo renamed to .github, filter out not .yml files
1 parent 1a656a4 commit c7f006f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<h1>create-dotgithub</h1>
3-
<p>Boring GitHub Dotfiles Generator (download from <a href="https://github.com/boringcodes/dotgithub">boringcodes/dotgithub</a>)</p>
3+
<p>Boring GitHub Dotfiles Generator (download from <a href="https://github.com/boringcodes/.github">boringcodes/.github</a>)</p>
44

55
<p>
66
<a href="https://github.com/boringcodes/create-dotgithub/commits" aria-label="Commitizen Friendly">

generators/app/index.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ const axios = require('axios').default;
66
const pkg = require('../../package.json');
77

88
const orgName = 'boringcodes';
9-
const repoName = 'dotgithub';
9+
const repoName = '.github';
1010
const getApiUrl = (type, sha) => {
1111
const ghApiUrl = 'https://api.github.com';
1212

1313
return `${ghApiUrl}/repos/${orgName}/${repoName}/git/${type}/${sha}`;
1414
};
1515
const findWorkflowsFromTree = (tree) => {
16-
return tree.find(({ path, type }) => path === 'workflows' && type === 'tree');
16+
return tree.find(
17+
({ path, type }) => path === 'workflow-templates' && type === 'tree',
18+
);
1719
};
1820

1921
module.exports = class extends Generator {
@@ -34,10 +36,12 @@ module.exports = class extends Generator {
3436
type: 'list',
3537
name: 'elementSelectedWorkflow',
3638
message: 'Please select the workflow you want to add?',
37-
choices: workflowsDir.tree.map((item) => ({
38-
name: item.path,
39-
value: item,
40-
})),
39+
choices: workflowsDir.tree
40+
.filter((item) => /\.yml$/.exec(item.path))
41+
.map((item) => ({
42+
name: item.path,
43+
value: item,
44+
})),
4145
},
4246
];
4347

0 commit comments

Comments
 (0)