Repository navigation
fix: change workflow glob pattern from .yml to .yaml #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6a9bfb8
4c0a125
27dd92d
7bc37e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -80,7 +80,7 @@ def _create_push_branch(branch: str): | |||||||||||||||
| _add_workflow(path, language) | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| def add_github_repo( | ||||||||||||||||
| def create_github_repo( | ||||||||||||||||
| repo: str, | ||||||||||||||||
| private: bool, | ||||||||||||||||
| language: str, | ||||||||||||||||
|
|
@@ -117,21 +117,21 @@ def _add_workflow(path: Path, language: str, workflow_dir: Path | None = None) - | |||||||||||||||
| workflow_dir = Path(__file__).parent / "workflows" | ||||||||||||||||
| dir_dest = path / ".github" / "workflows" | ||||||||||||||||
| dir_dest.mkdir(parents=True, exist_ok=True) | ||||||||||||||||
| for yaml in workflow_dir.glob("*.yml"): | ||||||||||||||||
| for yaml in workflow_dir.glob("*.yaml"): | ||||||||||||||||
| if not (dir_dest / yaml.name).exists(): | ||||||||||||||||
| shutil.copy2(yaml, dir_dest) | ||||||||||||||||
|
Comment on lines
+120
to
122
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restricting the search pattern to
Suggested change
|
||||||||||||||||
| if not language: | ||||||||||||||||
| return | ||||||||||||||||
| lang_dir = workflow_dir / language | ||||||||||||||||
| if not lang_dir.exists(): | ||||||||||||||||
| return | ||||||||||||||||
| for yaml in lang_dir.glob("*.yml"): | ||||||||||||||||
| for yaml in lang_dir.glob("*.yaml"): | ||||||||||||||||
| if not (dir_dest / yaml.name).exists(): | ||||||||||||||||
| shutil.copy2(yaml, dir_dest) | ||||||||||||||||
|
dclong marked this conversation as resolved.
Resolved
Comment on lines
+128
to
130
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restricting the search pattern to
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| def parse_args(args=None, namespace=None): | ||||||||||||||||
| parser = argparse.ArgumentParser(description="Add a GitHub repository.") | ||||||||||||||||
| parser = argparse.ArgumentParser(description="Create a GitHub repository.") | ||||||||||||||||
| parser.add_argument( | ||||||||||||||||
| "repo", | ||||||||||||||||
| help="The GitHub repo (in the format of owner/repo) to be created.", | ||||||||||||||||
|
|
@@ -203,7 +203,7 @@ def parse_args(args=None, namespace=None): | |||||||||||||||
| def main() -> int: | ||||||||||||||||
| args = parse_args() | ||||||||||||||||
| try: | ||||||||||||||||
| add_github_repo( | ||||||||||||||||
| create_github_repo( | ||||||||||||||||
| repo=args.repo, | ||||||||||||||||
| private=args.private, | ||||||||||||||||
| language=args.language, | ||||||||||||||||
|
|
||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.