structkit 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. structkit/__init__.py +6 -0
  2. structkit/commands/__init__.py +17 -0
  3. structkit/commands/completion.py +65 -0
  4. structkit/commands/generate.py +397 -0
  5. structkit/commands/generate_schema.py +67 -0
  6. structkit/commands/import.py +63 -0
  7. structkit/commands/info.py +87 -0
  8. structkit/commands/init.py +52 -0
  9. structkit/commands/list.py +89 -0
  10. structkit/commands/mcp.py +100 -0
  11. structkit/commands/validate.py +129 -0
  12. structkit/completers.py +54 -0
  13. structkit/content_fetcher.py +249 -0
  14. structkit/contribs/README.md +271 -0
  15. structkit/contribs/ansible-playbook.yaml +38 -0
  16. structkit/contribs/chef-cookbook.yaml +51 -0
  17. structkit/contribs/ci-cd-pipelines.yaml +67 -0
  18. structkit/contribs/cloudformation-files.yaml +21 -0
  19. structkit/contribs/configs/chglog.yaml +31 -0
  20. structkit/contribs/configs/codeowners.yaml +3 -0
  21. structkit/contribs/configs/devcontainer.yaml +35 -0
  22. structkit/contribs/configs/editor-config.yaml +11 -0
  23. structkit/contribs/configs/eslint.yaml +30 -0
  24. structkit/contribs/configs/jshint.yaml +11 -0
  25. structkit/contribs/configs/kubectl.yaml +23 -0
  26. structkit/contribs/configs/prettier.yaml +19 -0
  27. structkit/contribs/docker-files.yaml +27 -0
  28. structkit/contribs/documentation-template.yaml +33 -0
  29. structkit/contribs/git-hooks.yaml +19 -0
  30. structkit/contribs/github/chatmodes/plan.yaml +18 -0
  31. structkit/contribs/github/instructions/generic.yaml +5 -0
  32. structkit/contribs/github/prompts/generic.yaml +4 -0
  33. structkit/contribs/github/prompts/react-form.yaml +17 -0
  34. structkit/contribs/github/prompts/security-api.yaml +8 -0
  35. structkit/contribs/github/prompts/struct.yaml +90 -0
  36. structkit/contribs/github/templates.yaml +91 -0
  37. structkit/contribs/github/workflows/codeql.yaml +88 -0
  38. structkit/contribs/github/workflows/execute-tf-workflow.yaml +39 -0
  39. structkit/contribs/github/workflows/labeler.yaml +77 -0
  40. structkit/contribs/github/workflows/pre-commit.yaml +27 -0
  41. structkit/contribs/github/workflows/release-drafter.yaml +77 -0
  42. structkit/contribs/github/workflows/run-struct.yaml +30 -0
  43. structkit/contribs/github/workflows/stale.yaml +16 -0
  44. structkit/contribs/helm-chart.yaml +160 -0
  45. structkit/contribs/kubernetes-manifests.yaml +103 -0
  46. structkit/contribs/project/custom-structures.yaml +24 -0
  47. structkit/contribs/project/generic.yaml +309 -0
  48. structkit/contribs/project/go.yaml +104 -0
  49. structkit/contribs/project/java.yaml +85 -0
  50. structkit/contribs/project/n8n.yaml +100 -0
  51. structkit/contribs/project/nodejs.yaml +101 -0
  52. structkit/contribs/project/python.yaml +136 -0
  53. structkit/contribs/project/ruby.yaml +130 -0
  54. structkit/contribs/project/rust.yaml +106 -0
  55. structkit/contribs/prompts/run-struct-trigger.yaml +18 -0
  56. structkit/contribs/terraform/apps/aws-accounts.yaml +21 -0
  57. structkit/contribs/terraform/apps/environments.yaml +41 -0
  58. structkit/contribs/terraform/apps/generic.yaml +41 -0
  59. structkit/contribs/terraform/apps/github-organization.yaml +40 -0
  60. structkit/contribs/terraform/apps/init.yaml +11 -0
  61. structkit/contribs/terraform/modules/generic.yaml +58 -0
  62. structkit/contribs/vagrant-files.yaml +21 -0
  63. structkit/file_item.py +182 -0
  64. structkit/filters.py +112 -0
  65. structkit/input_store.py +35 -0
  66. structkit/logging_config.py +36 -0
  67. structkit/main.py +85 -0
  68. structkit/mcp_server.py +347 -0
  69. structkit/model_wrapper.py +47 -0
  70. structkit/template_renderer.py +258 -0
  71. structkit/utils.py +36 -0
  72. structkit-3.0.0.dist-info/METADATA +182 -0
  73. structkit-3.0.0.dist-info/RECORD +77 -0
  74. structkit-3.0.0.dist-info/WHEEL +5 -0
  75. structkit-3.0.0.dist-info/entry_points.txt +2 -0
  76. structkit-3.0.0.dist-info/licenses/LICENSE +201 -0
  77. structkit-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ files:
2
+ - template.yaml:
3
+ content: |
4
+ Resources:
5
+ ExampleBucket:
6
+ Type: AWS::S3::Bucket
7
+ Properties:
8
+ BucketName: example-bucket
9
+ - parameters.json:
10
+ content: |
11
+ [
12
+ {
13
+ "ParameterKey": "BucketName",
14
+ "ParameterValue": "example-bucket"
15
+ }
16
+ ]
17
+ - deploy.sh:
18
+ permissions: 755
19
+ content: |
20
+ #!/bin/bash
21
+ aws cloudformation deploy --stack-name example-stack --template-file template.yaml --parameter-overrides $(cat parameters.json | jq -r '.[] | "--parameters \(.ParameterKey)=\(.ParameterValue)"') --capabilities CAPABILITY_IAM
@@ -0,0 +1,31 @@
1
+ files:
2
+ - .chglog/config.yaml:
3
+ content: |
4
+ style: github
5
+ template: CHANGELOG.tpl.md
6
+ info:
7
+ title: CHANGELOG
8
+ repository_url: https://github.com/uridium/terraform-aws-ec2-connect-endpoint
9
+ options:
10
+ header:
11
+ pattern: "^((\\w+)\\s.*)$"
12
+ pattern_maps:
13
+ - Subject
14
+ - .chglog/CHANGELOG.tpl.md:
15
+ content: |
16
+ # CHANGELOG
17
+ {{ range .Versions }}
18
+ <a name="{{ .Tag.Name }}"></a>
19
+ ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
20
+ {{ range .Commits -}}
21
+ {{- if not (hasPrefix .Subject "Merge pull") -}}
22
+ {{- if not (contains .Subject "README") -}}
23
+ {{- if not (hasSuffix .Subject "[ci skip]") -}}
24
+ {{- if not (hasSuffix .Subject "[skip ci]") -}}
25
+ * {{ .Subject }}
26
+ {{ end -}}
27
+ {{ end -}}
28
+ {{ end -}}
29
+ {{ end -}}
30
+ {{ end -}}
31
+ {{ end -}}
@@ -0,0 +1,3 @@
1
+ files:
2
+ - CODEOWNERS: |
3
+ * @github_username
@@ -0,0 +1,35 @@
1
+ files:
2
+ - .devcontainer/devcontainer.json:
3
+ content: |
4
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
5
+ // README at: https://github.com/devcontainers/templates/tree/main/src/python
6
+ {
7
+ "name": "Python 3",
8
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
9
+ "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
10
+ "features": {
11
+ "ghcr.io/devcontainers/features/python:1": {
12
+ "installTools": true,
13
+ "version": "latest"
14
+ },
15
+ "ghcr.io/lentzi90/features/yamlfmt:0": {
16
+ "version": "v0.14.0"
17
+ },
18
+ "ghcr.io/gvatsal60/dev-container-features/pre-commit:1": {}
19
+ }
20
+
21
+ // Features to add to the dev container. More info: https://containers.dev/features.
22
+ // "features": {},
23
+
24
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
25
+ // "forwardPorts": [],
26
+
27
+ // Use 'postCreateCommand' to run commands after the container is created.
28
+ // "postCreateCommand": "pip3 install --user -r requirements.txt",
29
+
30
+ // Configure tool-specific properties.
31
+ // "customizations": {},
32
+
33
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
34
+ // "remoteUser": "root"
35
+ }
@@ -0,0 +1,11 @@
1
+ files:
2
+ - .editorconfig:
3
+ content: |
4
+ root = true
5
+ [*]
6
+ charset = utf-8
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ indent_style = space
10
+ indent_size = 2
11
+ trim_trailing_whitespace = true
@@ -0,0 +1,30 @@
1
+ files:
2
+ - .eslintrc.json:
3
+ content: |
4
+ {
5
+ "env": {
6
+ "browser": true,
7
+ "es2021": true
8
+ },
9
+ "extends": [
10
+ "eslint:recommended",
11
+ "plugin:react/recommended"
12
+ ],
13
+ "parserOptions": {
14
+ "ecmaFeatures": {
15
+ "jsx": true
16
+ },
17
+ "ecmaVersion": 12,
18
+ "sourceType": "module"
19
+ },
20
+ "plugins": [
21
+ "react"
22
+ ],
23
+ "rules": {
24
+ "react/prop-types": "off"
25
+ }
26
+ }
27
+ - .eslintignore:
28
+ content: |
29
+ node_modules/
30
+ dist/
@@ -0,0 +1,11 @@
1
+ files:
2
+ - .jshintrc:
3
+ content: |
4
+ {
5
+ "node": true,
6
+ "esversion": 6
7
+ }
8
+ - .jshintignore:
9
+ content: |
10
+ node_modules/
11
+ dist/
@@ -0,0 +1,23 @@
1
+ files:
2
+ - .kuberc:
3
+ content: |
4
+ apiVersion: kubectl.config.k8s.io/v1alpha1
5
+ kind: Preference
6
+ # alias "kubectl crns" for "kubectl create namespace {{@ namespace @}}"
7
+ aliases:
8
+ - name: crns
9
+ command: create namespace
10
+ appendArgs:
11
+ - {{@ namespace @}}
12
+ # Force the --interactive=true flag for kubectl delete
13
+ overrides:
14
+ - command: delete
15
+ flags:
16
+ - name: interactive
17
+ default: "true"
18
+
19
+ variables:
20
+ - namespace:
21
+ description: The name of the namespace to create.
22
+ type: string
23
+ default: default
@@ -0,0 +1,19 @@
1
+ files:
2
+ - .prettierrc:
3
+ content: |
4
+ {
5
+ "semi": true,
6
+ "trailingComma": "es5",
7
+ "singleQuote": true,
8
+ "endOfLine": "lf",
9
+ "tabWidth": 2,
10
+ "arrowParens": "always",
11
+ "printWidth": 80,
12
+ "bracketSpacing": true,
13
+ "quoteProps": "as-needed",
14
+ "proseWrap": "preserve"
15
+ }
16
+ - .prettierignore:
17
+ content: |
18
+ node_modules/
19
+ dist/
@@ -0,0 +1,27 @@
1
+ files:
2
+ - Dockerfile:
3
+ content: |
4
+ FROM nginx:latest
5
+ COPY index.html /usr/share/nginx/html/index.html
6
+ - .dockerignore:
7
+ content: |
8
+ .git
9
+ .idea
10
+ .vscode
11
+ - docker-compose.yml:
12
+ content: |
13
+ version: '3'
14
+ services:
15
+ web:
16
+ build: .
17
+ env_file:
18
+ - .env
19
+ ports:
20
+ - "80:80"
21
+ db:
22
+ image: mysql:latest
23
+ environment:
24
+ MYSQL_ROOT_PASSWORD: example
25
+ - .env:
26
+ content: |
27
+ MYSQL_ROOT_PASSWORD=example
@@ -0,0 +1,33 @@
1
+ files:
2
+ - README.md:
3
+ content: |
4
+ # {{@ project_name @}}
5
+
6
+ Brief description of the project.
7
+
8
+ ## Installation
9
+
10
+ Steps to install the project.
11
+
12
+ ## Usage
13
+
14
+ Instructions to use the project.
15
+
16
+ ## Contributing
17
+
18
+ Guidelines for contributing to the project.
19
+ - CONTRIBUTING.md:
20
+ content: |
21
+ # Contributing to {{@ project_name @}}
22
+
23
+ ## How to Contribute
24
+ Guidelines for how to contribute to the project.
25
+
26
+ ## Code of Conduct
27
+ Code of conduct for contributors.
28
+ - CODE_OF_CONDUCT.md:
29
+ content: |
30
+ # Code of Conduct
31
+ Our standards for how to behave within our community.
32
+ - LICENSE.md:
33
+ file: https://raw.githubusercontent.com/git/git-scm.com/main/MIT-LICENSE.txt
@@ -0,0 +1,19 @@
1
+ files:
2
+ - .git/hooks/pre-commit:
3
+ permissions: 755
4
+ content: |
5
+ #!/bin/sh
6
+ echo "Running pre-commit hook"
7
+ # Add pre-commit tasks here
8
+ - .git/hooks/pre-push:
9
+ permissions: 755
10
+ content: |
11
+ #!/bin/sh
12
+ echo "Running pre-push hook"
13
+ # Add pre-push tasks here
14
+ - .git/hooks/commit-msg:
15
+ permissions: 755
16
+ content: |
17
+ #!/bin/sh
18
+ echo "Running commit-msg hook"
19
+ # Add commit-msg tasks here
@@ -0,0 +1,18 @@
1
+ files:
2
+ - ./github/chatmodes/plan.chatmode.md:
3
+ content: |
4
+ ---
5
+ description: Generate an implementation plan for new features or refactoring existing code.
6
+ tools: ['codebase', 'fetch', 'findTestFiles', 'githubRepo', 'search', 'usages']
7
+ model: Claude Sonnet 4
8
+ ---
9
+ # Planning mode instructions
10
+ You are in planning mode. Your task is to generate an implementation plan for a new feature or for refactoring existing code.
11
+ Don't make any code edits, just generate a plan.
12
+
13
+ The plan consists of a Markdown document that describes the implementation plan, including the following sections:
14
+
15
+ * Overview: A brief description of the feature or refactoring task.
16
+ * Requirements: A list of requirements for the feature or refactoring task.
17
+ * Implementation Steps: A detailed list of steps to implement the feature or refactoring task.
18
+ * Testing: A list of tests that need to be implemented to verify the feature or refactoring task.
@@ -0,0 +1,5 @@
1
+ files:
2
+ - .github/instructions/generic.instruction.md:
3
+ skip_if_exists: true
4
+ content: |
5
+ Your instructions here
@@ -0,0 +1,4 @@
1
+ files:
2
+ - .github/prompts/generic.prompt.md:
3
+ content: |
4
+ Your prompt here
@@ -0,0 +1,17 @@
1
+ files:
2
+ - .github/prompts/react-form.prompt.md:
3
+ content: |
4
+ Your goal is to generate a new React form component.
5
+
6
+ Ask for the form name and fields if not provided.
7
+
8
+ Requirements for the form:
9
+ * Use form design system components: [design-system/Form.md](../docs/design-system/Form.md)
10
+ * Use `react-hook-form` for form state management:
11
+ * Always define TypeScript types for your form data
12
+ * Prefer *uncontrolled* components using register
13
+ * Use `defaultValues` to prevent unnecessary rerenders
14
+ * Use `yup` for validation:
15
+ * Create reusable validation schemas in separate files
16
+ * Use TypeScript types to ensure type safety
17
+ * Customize UX-friendly validation rules
@@ -0,0 +1,8 @@
1
+ files:
2
+ - .github/prompts/security-api.prompt.md:
3
+ content: |
4
+ Secure REST API review:
5
+ * Ensure all endpoints are protected by authentication and authorization
6
+ * Validate all user inputs and sanitize data
7
+ * Implement rate limiting and throttling
8
+ * Implement logging and monitoring for security events
@@ -0,0 +1,90 @@
1
+ files:
2
+ - .github/prompts/struct.prompt.md:
3
+ content: |
4
+ # StructKit Assistant
5
+
6
+ ## Role
7
+
8
+ You are an expert assistant that generates valid `.struct.yaml` files for the [StructKit tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.
9
+
10
+ ## Defining the `.struct.yaml` file
11
+
12
+ this file has 3 main keys: `structures`, `folders`, and `variables`.
13
+
14
+ ### Defining structures
15
+
16
+ The `structures` key is used to define files that are created. Each file path should have a reference to the content it needs to put on the file or the content of the file itself.
17
+ For referencing the content of a file, you can use the `file:` key with the path to the file. this can also be a remote https file.
18
+ The content of the file can be defined using the `content:` key with a pipe notation (`|`) for multiline content.
19
+
20
+ ```yaml
21
+ structures:
22
+ - path/to/file.txt:
23
+ content: |
24
+ This is the content of the file.
25
+ - path/to/remote/file.txt:
26
+ file: https://example.com/file.txt
27
+ ```
28
+
29
+ ### Defining folders
30
+
31
+ The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of structkit files to call. Optionally, you can define the value of a variable using the `with:` key.
32
+ The list of structkit files available can be taken from all the files defined inside `structkit/contribs/`.
33
+ Remember the name of the structkit file is the path to the file without the `.yaml` extension.
34
+ Read from the structkit file to kown the variables that can be used.
35
+
36
+ ```yaml
37
+ folders:
38
+ - ./path/to/folder/:
39
+ struct:
40
+ - terraform/module
41
+ with:
42
+ variable_name: value
43
+ - ./:
44
+ struct:
45
+ - github/prompts/struct
46
+ ```
47
+
48
+ ### Defining variables
49
+
50
+ The `variables` key is used to define variables that can be used in the structkit files. Each variable should have a description, type, and optional default value.
51
+
52
+ ```yaml
53
+ variables:
54
+ - variable_name:
55
+ description: Description of the variable
56
+ type: string
57
+ default: default_value
58
+ ```
59
+
60
+ ## Important notes
61
+
62
+ - Follow the JSON Schema definition provided in the references.
63
+ - Use valid keys: `structures`, `folders`, and `variables`.
64
+ - if you want to define files, use the `structures:` key, and a list of file paths that are created. each file path should have a content key.
65
+ - if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of structkit keys. also if you want to define the value of a variable then you should use the `with:` key.
66
+ - Follow the conventions from the StructKit README provided in the references.
67
+ - Include content blocks under `content:` using pipe notation (`|`) when needed.
68
+ - Use `permissions`, `skip`, or `skip_if_exists` if specified. This is used only for the `structures` key.
69
+ - Use `file:` to reference the content of a file or `content:` to define the content of the file.
70
+ - Use `struct:` to define the list of structkit files to call for a folder.
71
+ - Optionally, use Jinja2 custom filters such as `| latest_release`, `| default_branch`, or `| slugify`.
72
+
73
+ ## Output
74
+
75
+ Only output the YAML content, no explanation or prose.
76
+
77
+ ## Example usage
78
+
79
+ - Create a project template for a Python CLI tool
80
+ - Generate a Terraform module with `terraform/module` sub-struct
81
+ - Using interactive variables for author/project name
82
+
83
+ If unsure of a value, use sensible defaults or define a variable.
84
+
85
+ Always return YAML that is syntactically correct and validated against the provided schema.
86
+
87
+ ## References
88
+
89
+ - [StructKit json schema](https://raw.githubusercontent.com/httpdss/structkit/refs/heads/main/struct-schema.json)
90
+ - [StructKit README](https://raw.githubusercontent.com/httpdss/structkit/refs/heads/main/README.md)
@@ -0,0 +1,91 @@
1
+ files:
2
+ - .github/PULL_REQUEST_TEMPLATE/bug_fix_template.md:
3
+ content: |
4
+ ## Bug Fix
5
+ ### Description
6
+ <!--- A clear and concise description of what the bug is. -->
7
+ ### Steps to Reproduce
8
+ <!--- Steps to reproduce the behavior: -->
9
+ 1. Go to '...'
10
+ 2. Click on '....'
11
+ 3. Scroll down to '....'
12
+ 4. See error
13
+ ### Expected Behavior
14
+ <!--- A clear and concise description of what you expected to happen. -->
15
+ ### Screenshots
16
+ <!--- If applicable, add screenshots to help explain your problem. -->
17
+ ### Additional context
18
+ <!--- Add any other context about the problem here. -->
19
+ - .github/PULL_REQUEST_TEMPLATE/feature_request_template.md:
20
+ content: |
21
+ ## Feature Request
22
+ ### Description
23
+ <!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [..
24
+ ### Solution
25
+ <!--- A clear and concise description of what you want to happen. -->
26
+ ### Alternatives
27
+ <!--- A clear and concise description of any alternative solutions or features you've considered. -->
28
+ ### Screenshots
29
+ <!--- If applicable, add screenshots to help explain your problem. -->
30
+ ### Additional context
31
+ <!--- Add any other context or screenshots about the feature request here. -->
32
+ - .github/PULL_REQUEST_TEMPLATE/pull_request_template.md:
33
+ content: |
34
+ # Description
35
+
36
+ Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
37
+
38
+ Fixes # (issue)
39
+
40
+ ## Type of change
41
+
42
+ Please delete options that are not relevant.
43
+
44
+ - [ ] Bug fix (non-breaking change which fixes an issue)
45
+ - [ ] New feature (non-breaking change which adds functionality)
46
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
47
+ - [ ] This change requires a documentation update
48
+
49
+ # How Has This Been Tested?
50
+
51
+ Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
52
+
53
+ - [ ] Test A
54
+ - [ ] Test B
55
+
56
+ **Test Configuration**:
57
+ * Firmware version:
58
+ * Hardware:
59
+ * Toolchain:
60
+ * SDK:
61
+
62
+ # Checklist:
63
+
64
+ - [ ] My code follows the style guidelines of this project
65
+ - [ ] I have performed a self-review of my code
66
+ - [ ] I have commented my code, particularly in hard-to-understand areas
67
+ - [ ] I have made corresponding changes to the documentation
68
+ - [ ] My changes generate no new warnings
69
+ - [ ] I have added tests that prove my fix is effective or that my feature works
70
+ - [ ] New and existing unit tests pass locally with my changes
71
+ - [ ] Any dependent changes have been merged and published in downstream modules
72
+ - .github/ISSUE_TEMPLATE/issue_template.md:
73
+ content: |
74
+ ## I'm submitting a ...
75
+
76
+ - [ ] bug report
77
+ - [ ] feature request
78
+
79
+ ## What is the current behavior?
80
+
81
+ ## If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
82
+
83
+ ## What is the expected behavior?
84
+
85
+ ## What is the motivation / use case for changing the behavior?
86
+
87
+ ## Please tell us about your environment:
88
+
89
+ Version: 2.0.0-beta.X
90
+ Browser:
91
+ Language:
@@ -0,0 +1,88 @@
1
+ files:
2
+ - .github/workflows/z-codeql.yaml:
3
+ content: | # yaml
4
+ # For most projects, this workflow file will not need changing; you simply need
5
+ # to commit it to your repository.
6
+ #
7
+ # You may wish to alter this file to override the set of languages analyzed,
8
+ # or to provide custom queries or build logic.
9
+ #
10
+ # ******** NOTE ********
11
+ # We have attempted to detect the languages in your repository. Please check
12
+ # the `language` matrix defined below to confirm you have the correct set of
13
+ # supported CodeQL languages.
14
+ #
15
+ name: 'CodeQL'
16
+
17
+ on:
18
+ push:
19
+ branches: ['develop', 'master', 'release**']
20
+ # paths-ignore:
21
+ # - '**/__mockData__'
22
+ pull_request:
23
+ # The branches below must be a subset of the branches above
24
+ branches: ['develop', 'release**']
25
+ # paths-ignore:
26
+ # - '**/__mockData__'
27
+ schedule:
28
+ - cron: '42 10 * * 1'
29
+
30
+ jobs:
31
+ analyze:
32
+ name: Analyze
33
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
34
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
35
+ # - https://gh.io/supported-runners-and-hardware-resources
36
+ # - https://gh.io/using-larger-runners
37
+ # Consider using larger runners for possible analysis time improvements.
38
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
39
+ timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
40
+ permissions:
41
+ actions: read
42
+ contents: read
43
+ security-events: write
44
+
45
+ strategy:
46
+ fail-fast: false
47
+ matrix:
48
+ language: ['javascript']
49
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
50
+ # Use only 'java' to analyze code written in Java, Kotlin or both
51
+ # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
52
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
53
+
54
+ steps:
55
+ - name: Checkout repository
56
+ uses: actions/checkout@{{@ "actions/checkout" | latest_release @}}
57
+
58
+ # Initializes the CodeQL tools for scanning.
59
+ - name: Initialize CodeQL
60
+ uses: github/codeql-action/init@{{@ "github/codeql-action" | latest_release @}}
61
+ with:
62
+ languages: ${{ matrix.language }}
63
+ # If you wish to specify custom queries, you can do so here or in a config file.
64
+ # By default, queries listed here will override any specified in a config file.
65
+ # Prefix the list here with '+' to use these queries and those in the config file.
66
+
67
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
68
+ # queries: security-extended,security-and-quality
69
+
70
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
71
+ # If this step fails, then you should remove it and run the build manually (see below)
72
+ - name: Autobuild
73
+ uses: github/codeql-action/autobuild@{{@ "github/codeql-action" | latest_release @}}
74
+
75
+ # ℹ️ Command-line programs to run using the OS shell.
76
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
77
+
78
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
79
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
80
+
81
+ # - run: |
82
+ # echo 'Run, Build Application using script'
83
+ # ./location_of_script_within_repo/buildscript.sh
84
+
85
+ - name: Perform CodeQL Analysis
86
+ uses: github/codeql-action/analyze@{{@ "github/codeql-action" | latest_release @}}
87
+ with:
88
+ category: '/language:${{matrix.language}}'
@@ -0,0 +1,39 @@
1
+ files:
2
+ - .github/workflows/execute-tf-{{@ app_name | slugify @}}.yaml:
3
+ content: |
4
+ name: 'execute-tf-{{@ app_name | slugify @}}'
5
+ on:
6
+ pull_request:
7
+ branches:
8
+ - main
9
+ paths:
10
+ - '.devops/apps/**'
11
+ - '.github/workflows/execute-tf-{{@ app_name | slugify @}}.yaml'
12
+ push:
13
+ branches:
14
+ - main
15
+ paths:
16
+ - '.devops/apps/**'
17
+ - '.github/workflows/execute-tf-{{@ app_name | slugify @}}.yaml'
18
+
19
+ jobs:
20
+ tf-workflow:
21
+ uses: httpdss/github-workflows/.github/workflows/execute-tf-workflow.yaml@main
22
+ with:
23
+ working-directory: '.devops/apps/{{@ app_path @}}'
24
+ secrets:
25
+ gh-token: {{@ github_token @}}
26
+
27
+ variables:
28
+ - app_name:
29
+ description: "The name of the app."
30
+ default: "environments-dev"
31
+ type: string
32
+ - app_path:
33
+ description: "The working directory for the terraform workflow."
34
+ default: "environments/dev"
35
+ type: string
36
+ - github_token:
37
+ description: "The GitHub token for authentication."
38
+ default: "${{ secrets.GITHUB_TOKEN }}"
39
+ type: string