From 9756f8b13b3411dd4b9ee4ba1530cbc3f70e17f7 Mon Sep 17 00:00:00 2001 From: Kenneth Belitzky Date: Wed, 19 Mar 2025 12:22:08 -0300 Subject: [PATCH 1/5] Add new prompt configurations for GitHub contributions --- .../contribs/github/prompts/generic.yaml | 4 ++++ .../contribs/github/prompts/react-form.yaml | 17 +++++++++++++++++ .../contribs/github/prompts/security-api.yaml | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 struct_module/contribs/github/prompts/generic.yaml create mode 100644 struct_module/contribs/github/prompts/react-form.yaml create mode 100644 struct_module/contribs/github/prompts/security-api.yaml diff --git a/struct_module/contribs/github/prompts/generic.yaml b/struct_module/contribs/github/prompts/generic.yaml new file mode 100644 index 0000000..9dbc734 --- /dev/null +++ b/struct_module/contribs/github/prompts/generic.yaml @@ -0,0 +1,4 @@ +structure: + - .github/prompts/generic.prompt.md: + content: | + Your prompt here diff --git a/struct_module/contribs/github/prompts/react-form.yaml b/struct_module/contribs/github/prompts/react-form.yaml new file mode 100644 index 0000000..2c6f0a6 --- /dev/null +++ b/struct_module/contribs/github/prompts/react-form.yaml @@ -0,0 +1,17 @@ +structure: + - .github/prompts/react-form.prompt.md: + content: | + Your goal is to generate a new React form component. + + Ask for the form name and fields if not provided. + + Requirements for the form: + * Use form design system components: [design-system/Form.md](../docs/design-system/Form.md) + * Use `react-hook-form` for form state management: + * Always define TypeScript types for your form data + * Prefer *uncontrolled* components using register + * Use `defaultValues` to prevent unnecessary rerenders + * Use `yup` for validation: + * Create reusable validation schemas in separate files + * Use TypeScript types to ensure type safety + * Customize UX-friendly validation rules diff --git a/struct_module/contribs/github/prompts/security-api.yaml b/struct_module/contribs/github/prompts/security-api.yaml new file mode 100644 index 0000000..417b232 --- /dev/null +++ b/struct_module/contribs/github/prompts/security-api.yaml @@ -0,0 +1,8 @@ +structure: + - .github/prompts/security-api.prompt.md: + content: | + Secure REST API review: + * Ensure all endpoints are protected by authentication and authorization + * Validate all user inputs and sanitize data + * Implement rate limiting and throttling + * Implement logging and monitoring for security events From a33eded69081a67fc8bb678f7602136d70f4d8fb Mon Sep 17 00:00:00 2001 From: Kenneth Belitzky Date: Sun, 23 Mar 2025 16:33:14 +0000 Subject: [PATCH 2/5] Add GitHub workflows for pre-commit checks and release drafting; include new prompt structure --- .devcontainer/devcontainer.json | 3 +- .github/prompts/struct.prompt.md | 88 ++++++ .github/workflows/release-drafter.yaml | 8 +- .github/workflows/z-pre-commit.yaml | 13 + .struct.yaml | 1 + struct_module/contribs/README.md | 271 ++++++++++++++++++ .../contribs/github/prompts/struct.yaml | 91 ++++++ 7 files changed, 473 insertions(+), 2 deletions(-) create mode 100644 .github/prompts/struct.prompt.md create mode 100644 .github/workflows/z-pre-commit.yaml create mode 100644 struct_module/contribs/README.md create mode 100644 struct_module/contribs/github/prompts/struct.yaml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3dcef03..ea39f38 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,8 @@ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye", "features": { - + "ghcr.io/gvatsal60/dev-container-features/pre-commit": {}, + "ghcr.io/eitsupi/devcontainer-features/go-task:latest": {} }, // Features to add to the dev container. More info: https://containers.dev/features. diff --git a/.github/prompts/struct.prompt.md b/.github/prompts/struct.prompt.md new file mode 100644 index 0000000..dd1f9d9 --- /dev/null +++ b/.github/prompts/struct.prompt.md @@ -0,0 +1,88 @@ +# Struct Assistant + +## Role + +You are an expert assistant that generates valid `.struct.yaml` files for the [STRUCT tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration. + +## Defining the `.struct.yaml` file + +this file has 3 main keys: `structures`, `folders`, and `variables`. + +### Defining structures + +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. +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. +The content of the file can be defined using the `content:` key with a pipe notation (`|`) for multiline content. + +```yaml +structures: + - path/to/file.txt: + content: | + This is the content of the file. + - path/to/remote/file.txt: + file: https://example.com/file.txt +``` + +### Defining folders + +The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of struct files to call. Optionally, you can define the value of a variable using the `with:` key. +The list of struct files available can be taken from all the files defined inside `struct_module/contribs/`. +Remember the name of the struct file is the path to the file without the `.yaml` extension. +Read from the struct file to kown the variables that can be used. + +```yaml +folders: + - ./path/to/folder/: + struct: + - terraform/module + with: + variable_name: value + - ./: + struct: + - github/prompts/struct +``` + + +### Defining variables + +The `variables` key is used to define variables that can be used in the struct files. Each variable should have a description, type, and optional default value. + +```yaml +variables: + - variable_name: + description: Description of the variable + type: string + default: default_value +``` + +## Important notes + +- Follow the JSON Schema definition provided in the references. +- Use valid keys: `structures`, `folders`, and `variables`. +- 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. +- 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 struct keys. also if you want to define the value of a variable then you should use the `with:` key. +- Follow the conventions from the STRUCT README provided in the references. +- Include content blocks under `content:` using pipe notation (`|`) when needed. +- Use `permissions`, `skip`, or `skip_if_exists` if specified. This is used only for the `structures` key. +- Use `file:` to reference the content of a file or `content:` to define the content of the file. +- Use `struct:` to define the list of struct files to call for a folder. +- Optionally, use Jinja2 custom filters such as `| latest_release`, `| default_branch`, or `| slugify`. + +## Output + +Only output the YAML content, no explanation or prose. + +## Example usage + +- Create a project template for a Python CLI tool +- Generate a Terraform module with `terraform/module` sub-struct +- Using interactive variables for author/project name + +If unsure of a value, use sensible defaults or define a variable. + +Always return YAML that is syntactically correct and validated against the provided schema. + +## References + +- [STRUCT json schema](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/struct-schema.json) +- [STRUCT README](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/README.md) diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml index a76609e..bd5675b 100644 --- a/.github/workflows/release-drafter.yaml +++ b/.github/workflows/release-drafter.yaml @@ -12,9 +12,15 @@ jobs: contents: write pull-requests: write steps: - - uses: release-drafter/release-drafter@v6 + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + - uses: release-drafter/release-drafter@v6.1.0 id: release-drafter with: config-name: release-drafter.yml + publish: false + prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/z-pre-commit.yaml b/.github/workflows/z-pre-commit.yaml new file mode 100644 index 0000000..bbefa36 --- /dev/null +++ b/.github/workflows/z-pre-commit.yaml @@ -0,0 +1,13 @@ +name: z-pre-commit + +on: + pull_request: + branches: + - main + +jobs: + terraform-docs: + uses: beachbodydigital/devops-github-workflows/.github/workflows/terraform-docs.yaml@v5 + pre-commit: + needs: terraform-docs + uses: beachbodydigital/devops-github-workflows/.github/workflows/common-pre-commit.yaml@v5 diff --git a/.struct.yaml b/.struct.yaml index 7e14cae..66d253e 100644 --- a/.struct.yaml +++ b/.struct.yaml @@ -1,5 +1,6 @@ folders: - ./: struct: + - github/prompts/struct - github/workflows/pre-commit - github/workflows/release-drafter diff --git a/struct_module/contribs/README.md b/struct_module/contribs/README.md new file mode 100644 index 0000000..133ce43 --- /dev/null +++ b/struct_module/contribs/README.md @@ -0,0 +1,271 @@ +# Contribs Sub-Structs + +The `contribs` folder contains various sub-structs that can be used to generate specific project structures or configurations. Below is a list of all the YAML files in this folder, along with a brief description of what they do and when to use them. + +## Table of content + +## Table of Contents + +- [Contribs Sub-Structs](#contribs-sub-structs) + - [Sub-Structs](#sub-structs) + - [General](#general) + - [`ansible-playbook`](#ansible-playbook) + - [`chef-cookbook`](#chef-cookbook) + - [`ci-cd-pipelines`](#ci-cd-pipelines) + - [`cloudformation-files`](#cloudformation-files) + - [`docker-files`](#docker-files) + - [`documentation-template`](#documentation-template) + - [`git-hooks`](#git-hooks) + - [`helm-chart`](#helm-chart) + - [`kubernetes-manifests`](#kubernetes-manifests) + - [`vagrant-files`](#vagrant-files) + - [Configs](#configs) + - [`configs/codeowners`](#configscodeowners) + - [`configs/devcontainer`](#configsdevcontainer) + - [`configs/editor-config`](#configseditor-config) + - [`configs/eslint`](#configseslint) + - [`configs/jshint`](#configsjshint) + - [`configs/prettier`](#configsprettier) + - [Github](#github) + - [`github/workflows/execute-tf-workflow`](#githubworkflowsexecute-tf-workflow) + - [`github/workflows/pre-commit`](#githubworkflowspre-commit) + - [`github/workflows/labeler`](#githubworkflowslabeler) + - [`github/workflows/release-drafter`](#githubworkflowsrelease-drafter) + - [`github/workflows/run-struct`](#githubworkflowsrun-struct) + - [`github/workflows/stale`](#githubworkflowsstale) + - [`github/templates`](#githubtemplates) + - [`github/prompts/generic`](#githubpromptsgeneric) + - [`github/prompts/react-form`](#githubpromptsreact-form) + - [`github/prompts/security-api`](#githubpromptssecurity-api) + - [`github/prompts/struct`](#githubpromptsstruct) + - [Project](#project) + - [`project/generic`](#projectgeneric) + - [`project/java`](#projectjava) + - [`project/nodejs`](#projectnodejs) + - [`project/rust`](#projectrust) + - [`project/python`](#projectpython) + - [`project/go`](#projectgo) + - [`project/ruby`](#projectruby) + - [Terraform](#terraform) + - [`terraform/modules/generic`](#terraformmodulesgeneric) + - [`terraform/apps/generic`](#terraformappsgeneric) + - [`terraform/apps/aws-accounts`](#terraformappsaws-accounts) + - [`terraform/apps/github-organization`](#terraformappsgithub-organization) + - [`terraform/apps/environments`](#terraformappsenvironments) + - [`terraform/apps/init`](#terraformappsinit) + +## Sub-Structs + +### General + +#### `ansible-playbook` + +- **Description**: Generates a basic structure for an Ansible playbook, including tasks, variables, handlers, and templates. +- **When to Use**: Use this sub-struct when you need to create an Ansible playbook for automating infrastructure or application deployments. + +#### `chef-cookbook` + +- **Description**: Creates a Chef cookbook structure with recipes, attributes, templates, and files. +- **When to Use**: Use this sub-struct when you need to create a Chef cookbook for automating infrastructure or application deployments. + +#### `ci-cd-pipelines` + +- **Description**: Provides a structure for setting up CI/CD pipelines. +- **When to Use**: this sub-struct should only be used as a reference for setting up CI/CD pipelines. + +#### `cloudformation-files` + +- **Description**: Generates a basic structure for AWS CloudFormation templates, including a deployment script and parameters file. +- **When to Use**: Use this sub-struct when you need to define and deploy AWS infrastructure using CloudFormation. + +#### `docker-files` + +- **Description**: Creates a structure for Docker-related files, such as Dockerfiles and docker-compose configurations. +- **When to Use**: Use this sub-struct when you need to define and build Docker images for your application. Another use case is when you need to define and run multi-container applications using Docker Compose. + +#### `documentation-template` + +- **Description**: Provides a template for project documentation. +- **Description**: This sub-struct is useful when you need to create a documentation structure for your project. + +#### `git-hooks` + +- **Description**: Sets up Git hooks, such as pre-commit, pre-push, and commit-msg hooks. +- **When to Use**: Use this sub-struct when you need to enforce custom Git workflows or validations. + +#### `helm-chart` + +- **Description**: Generates a Helm chart structure for Kubernetes deployments, including templates and configuration files. +- **When to Use**: Use this sub-struct when you need to deploy applications to Kubernetes using Helm. + +#### `kubernetes-manifests` + +- **Description**: Creates a structure for Kubernetes manifests, such as deployments, services, and ingress configurations. +- **When to Use**: Use this sub-struct when you need to define and deploy Kubernetes resources for your application. + +#### `vagrant-files` + +- **Description**: Provides a structure for setting up a Vagrant development environment, including a Vagrantfile and provisioning scripts. +- **When to Use**: Use this sub-struct when you need to create a Vagrant development environment for your project. + +### Configs + +#### `configs/codeowners` + +- **Description**: Provides a template for the `.github/CODEOWNERS` file. +- **When to Use**: Use this sub-struct when you need to define code owners for your project's repository. + +#### `configs/devcontainer` + +- **Description**: Provides a template for the `.devcontainer` folder, which contains configuration files for Visual Studio Code's Remote - Containers extension. +- **When to Use**: Use this sub-struct when you need to define development container configurations for your project. + +#### `configs/editor-config` + +- **Description**: Provides a template for the `.editorconfig` file, which defines coding styles and formatting rules for different editors and IDEs. +- **When to Use**: Use this sub-struct when you need to define coding styles and formatting rules for your project. + +#### `configs/eslint` + +- **Description**: Provides a template for the `.eslintrc` file, which defines ESLint configurations for JavaScript projects. +- **When to Use**: Use this sub-struct when you need to define ESLint configurations for your JavaScript project. + +#### `configs/jshint` + +- **Description**: Provides a template for the `.jshintrc` file, which defines JSHint configurations for JavaScript projects. +- **When to Use**: Use this sub-struct when you need to define JSHint configurations for your JavaScript project. + +#### `configs/prettier` + +- **Description**: Provides a template for the `.prettierrc` file, which defines Prettier configurations for code formatting. +- **When to Use**: Use this sub-struct when you need to define Prettier configurations for your project. + +### Github + +#### `github/workflows/execute-tf-workflow` + +- **Description**: Provides a template for a GitHub Actions workflow that executes Terraform commands. +- **When to Use**: Use this sub-struct when you need to automate Terraform workflows using GitHub Actions. each terraform app should have a workflow that executes terraform commands. + +#### `github/workflows/pre-commit` + +- **Description**: Provides a template for a GitHub Actions workflow that runs pre-commit checks. +- **When to Use**: Use this sub-struct when you need to run pre-commit checks on your codebase using GitHub Actions. + +#### `github/workflows/labeler` + +- **Description**: Provides a template for a GitHub Actions workflow that labels issues and pull requests. +- **When to Use**: Use this sub-struct when you need to automatically label issues and pull requests based on certain criteria. + +#### `github/workflows/release-drafter` + +- **Description**: Provides a template for a GitHub Actions workflow that generates release notes using Release Drafter. +- **When to Use**: Use this sub-struct when you need to automatically generate release notes for your project using Release Drafter. + +#### `github/workflows/run-struct` + +- **Description**: Provides a template for a GitHub Actions workflow that runs the struct CLI. +- **When to Use**: Use this sub-struct when you need to run the struct CLI as part of your GitHub Actions workflows. + +#### `github/workflows/stale` + +- **Description**: Provides a template for a GitHub Actions workflow that closes stale issues and pull requests. +- **When to Use**: Use this sub-struct when you need to automatically close stale issues and pull requests in your repository. + +#### `github/templates` + +- **Description**: Provides templates for GitHub issue and pull request templates. +- **When to Use**: Use this sub-struct when you need to define issue and pull request templates for your GitHub repository. + +#### `github/prompts/generic` + +- **Description**: Provides a generic prompt for creating a new project structure. +- **When to Use**: Use this sub-struct when you need to create a new project structure using the struct CLI. + +#### `github/prompts/react-form` + +- **Description**: Provides a prompt for creating a React form component. +- **When to Use**: Use this sub-struct when you need to create a React form component. + +#### `github/prompts/security-api` + +- **Description**: Provides a prompt for creating a security API. +- **When to Use**: Use this sub-struct when you need to create a security API. + +#### `github/prompts/struct` + +- **Description**: Provides a prompt for creating a new .struct.yaml file and workflow to run struct. +- **When to Use**: Use this sub-struct when you need to create a new .struct.yaml file and workflow to run struct. + +### Project + +#### `project/generic` + +- **Description**: Provides a generic project structure with directories for source code, documentation, and tests. +- **When to Use**: Use this sub-struct when you need to create a generic project structure for your application. + +#### `project/java` + +- **Description**: Provides a Java project structure with directories for source code, resources, and tests. +- **When to Use**: Use this sub-struct when you need to create a Java project structure for your application. + +#### `project/nodejs` + +- **Description**: Provides a Node.js project structure with directories for source code, tests, and configuration files. +- **When to Use**: Use this sub-struct when you need to create a Node.js project structure for your application. + +#### `project/rust` + +- **Description**: Provides a Rust project structure with directories for source code, tests, and configuration files. +- **When to Use**: Use this sub-struct when you need to create a Rust project structure for your application. + +#### `project/python` + +- **Description**: Provides a Python project structure with directories for source code, tests, and configuration files. +- **When to Use**: Use this sub-struct when you need to create a Python project structure for your application. + +#### `project/go` + +- **Description**: Provides a Go project structure with directories for source code, tests, and configuration files. +- **When to Use**: Use this sub-struct when you need to create a Go project structure for your application. + +#### `project/ruby` + +- **Description**: Provides a Ruby project structure with directories for source code, tests, and configuration files. +- **When to Use**: Use this sub-struct when you need to create a Ruby project structure for your application. + +### Terraform + +#### `terraform/modules/generic` + +- **Description**: Provides a generic Terraform module structure with directories for resources, variables, and outputs. +- **When to Use**: Use this sub-struct when you need to create a generic Terraform module for your infrastructure. + +#### `terraform/apps/generic` + +- **Description**: Provides a generic Terraform application structure with directories for modules, environments, and configurations. +- **When to Use**: Use this sub-struct when you need to create a generic Terraform application for your infrastructure. + +#### `terraform/apps/aws-accounts` + +- **Description**: Provides a Terraform application structure for managing AWS accounts. +- **When to Use**: Use this sub-struct when you need to manage AWS accounts using Terraform. + +#### `terraform/apps/github-organization` + +- **Description**: Provides a Terraform application structure for managing GitHub organizations. +- **When to Use**: Use this sub-struct when you need to manage GitHub organizations using Terraform. + +#### `terraform/apps/environments` + +- **Description**: Provides a Terraform application structure for managing environments. +- **When to Use**: Use this sub-struct when you need to manage environments using Terraform. + +#### `terraform/apps/init` + +- **Description**: Provides a Terraform application structure for initializing a new project. +- **When to Use**: Use this sub-struct when you need to initialize a new Terraform project. + +--- + +Each of these sub-structs is designed to simplify the process of setting up specific project structures or configurations. Refer to the individual YAML files for more details on their usage and customization options. diff --git a/struct_module/contribs/github/prompts/struct.yaml b/struct_module/contribs/github/prompts/struct.yaml new file mode 100644 index 0000000..ab70722 --- /dev/null +++ b/struct_module/contribs/github/prompts/struct.yaml @@ -0,0 +1,91 @@ +structure: + - .github/prompts/struct.prompt.md: + content: | + # Struct Assistant + + ## Role + + You are an expert assistant that generates valid `.struct.yaml` files for the [STRUCT tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration. + + ## Defining the `.struct.yaml` file + + this file has 3 main keys: `structures`, `folders`, and `variables`. + + ### Defining structures + + 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. + 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. + The content of the file can be defined using the `content:` key with a pipe notation (`|`) for multiline content. + + ```yaml + structures: + - path/to/file.txt: + content: | + This is the content of the file. + - path/to/remote/file.txt: + file: https://example.com/file.txt + ``` + + ### Defining folders + + The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of struct files to call. Optionally, you can define the value of a variable using the `with:` key. + The list of struct files available can be taken from all the files defined inside `struct_module/contribs/`. + Remember the name of the struct file is the path to the file without the `.yaml` extension. + Read from the struct file to kown the variables that can be used. + + ```yaml + folders: + - ./path/to/folder/: + struct: + - terraform/module + with: + variable_name: value + - ./: + struct: + - github/prompts/struct + ``` + + + ### Defining variables + + The `variables` key is used to define variables that can be used in the struct files. Each variable should have a description, type, and optional default value. + + ```yaml + variables: + - variable_name: + description: Description of the variable + type: string + default: default_value + ``` + + ## Important notes + + - Follow the JSON Schema definition provided in the references. + - Use valid keys: `structures`, `folders`, and `variables`. + - 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. + - 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 struct keys. also if you want to define the value of a variable then you should use the `with:` key. + - Follow the conventions from the STRUCT README provided in the references. + - Include content blocks under `content:` using pipe notation (`|`) when needed. + - Use `permissions`, `skip`, or `skip_if_exists` if specified. This is used only for the `structures` key. + - Use `file:` to reference the content of a file or `content:` to define the content of the file. + - Use `struct:` to define the list of struct files to call for a folder. + - Optionally, use Jinja2 custom filters such as `| latest_release`, `| default_branch`, or `| slugify`. + + ## Output + + Only output the YAML content, no explanation or prose. + + ## Example usage + + - Create a project template for a Python CLI tool + - Generate a Terraform module with `terraform/module` sub-struct + - Using interactive variables for author/project name + + If unsure of a value, use sensible defaults or define a variable. + + Always return YAML that is syntactically correct and validated against the provided schema. + + ## References + + - [STRUCT json schema](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/struct-schema.json) + - [STRUCT README](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/README.md) From 9b0358603bc910c4e3034f1e59fafefd8b078a6f Mon Sep 17 00:00:00 2001 From: Kenneth Belitzky Date: Mon, 31 Mar 2025 14:29:43 +0000 Subject: [PATCH 3/5] Update devcontainer configuration to include shfmt feature and adjust mounts --- .devcontainer/devcontainer.json | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ea39f38..ec25b66 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,24 +1,12 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python { "name": "Struct devcontainer", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye", "features": { "ghcr.io/gvatsal60/dev-container-features/pre-commit": {}, - "ghcr.io/eitsupi/devcontainer-features/go-task:latest": {} + "ghcr.io/eitsupi/devcontainer-features/go-task:latest": {}, + "ghcr.io/devcontainers-extra/features/shfmt:1" : {} }, - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "bash ./scripts/devcontainer_start.sh", - - // Configure tool-specific properties. "customizations": { "vscode": { "extensions": [ @@ -36,7 +24,8 @@ ] } }, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - "remoteUser": "root" + "mounts": [ + "type=bind,source=${localWorkspaceFolder},target=/work", + "type=bind,source=/home/${localEnv:USER}/.ssh,target=/home/vscode/.ssh,readonly" + ] } From e60aa9fdcccf1351dd2984b20e3cddd37229a642 Mon Sep 17 00:00:00 2001 From: Kenneth Belitzky Date: Mon, 31 Mar 2025 15:03:01 +0000 Subject: [PATCH 4/5] Update pre-commit workflow and clean up prompt documentation --- .github/prompts/struct.prompt.md | 1 - .github/workflows/pre-commit.yaml | 2 +- struct_module/contribs/github/prompts/struct.yaml | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/prompts/struct.prompt.md b/.github/prompts/struct.prompt.md index dd1f9d9..c8fbc0c 100644 --- a/.github/prompts/struct.prompt.md +++ b/.github/prompts/struct.prompt.md @@ -42,7 +42,6 @@ folders: - github/prompts/struct ``` - ### Defining variables The `variables` key is used to define variables that can be used in the struct files. Each variable should have a description, type, and optional default value. diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 94820be..ce0fc86 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -11,5 +11,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.2.2 - - uses: actions/setup-python@v5.3.0 + - uses: actions/setup-python@v5.5.0 - uses: pre-commit/action@v3.0.1 diff --git a/struct_module/contribs/github/prompts/struct.yaml b/struct_module/contribs/github/prompts/struct.yaml index ab70722..99a3510 100644 --- a/struct_module/contribs/github/prompts/struct.yaml +++ b/struct_module/contribs/github/prompts/struct.yaml @@ -45,7 +45,6 @@ structure: - github/prompts/struct ``` - ### Defining variables The `variables` key is used to define variables that can be used in the struct files. Each variable should have a description, type, and optional default value. From 2d077da35f1a5596bbd37724ba64dcba56864a2d Mon Sep 17 00:00:00 2001 From: Kenneth Belitzky Date: Mon, 31 Mar 2025 15:11:04 +0000 Subject: [PATCH 5/5] Remove deprecated z-pre-commit workflow file --- .github/workflows/z-pre-commit.yaml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .github/workflows/z-pre-commit.yaml diff --git a/.github/workflows/z-pre-commit.yaml b/.github/workflows/z-pre-commit.yaml deleted file mode 100644 index bbefa36..0000000 --- a/.github/workflows/z-pre-commit.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: z-pre-commit - -on: - pull_request: - branches: - - main - -jobs: - terraform-docs: - uses: beachbodydigital/devops-github-workflows/.github/workflows/terraform-docs.yaml@v5 - pre-commit: - needs: terraform-docs - uses: beachbodydigital/devops-github-workflows/.github/workflows/common-pre-commit.yaml@v5