From 6f4f96e32689c0c261ba8acb20378bb13004dfb8 Mon Sep 17 00:00:00 2001 From: Nick Alteen Date: Fri, 11 Jul 2025 13:36:30 -0400 Subject: [PATCH 1/3] Update workflows and configs from template --- .github/linters/.checkov.yaml | 6 ----- .github/workflows/ci.yml | 2 ++ .github/workflows/linter.yml | 8 +++++++ .../.markdown-lint.yml => .markdown-lint.yml | 6 +++++ .prettierrc.json | 16 ------------- .prettierrc.yml | 16 +++++++++++++ .../linters/.yaml-lint.yml => .yaml-lint.yml | 4 ++++ CODEOWNERS | 6 ++++- README.md | 23 +++++++------------ action.yml | 17 +++++++++----- 10 files changed, 60 insertions(+), 44 deletions(-) delete mode 100644 .github/linters/.checkov.yaml rename .github/linters/.markdown-lint.yml => .markdown-lint.yml (67%) delete mode 100644 .prettierrc.json create mode 100644 .prettierrc.yml rename .github/linters/.yaml-lint.yml => .yaml-lint.yml (74%) diff --git a/.github/linters/.checkov.yaml b/.github/linters/.checkov.yaml deleted file mode 100644 index c306051..0000000 --- a/.github/linters/.checkov.yaml +++ /dev/null @@ -1,6 +0,0 @@ -quiet: true -skip-check: - # Ensure that HEALTHCHECK instructions have been added to container images - - CKV_DOCKER_2 - # Ensure that a user for the container has been created - - CKV_DOCKER_3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 424f06e..1b344dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,8 @@ name: Continuous Integration on: pull_request: + branches: + - main push: branches: - main diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index be00c92..5608770 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,7 +1,14 @@ +# This workflow will lint the entire codebase using the +# `super-linter/super-linter` action. +# +# For more information, see the super-linter repository: +# https://github.com/super-linter/super-linter name: Lint Codebase on: pull_request: + branches: + - main push: branches: - main @@ -29,4 +36,5 @@ jobs: env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LINTER_RULES_PATH: ${{ github.workspace }} VALIDATE_ALL_CODEBASE: true diff --git a/.github/linters/.markdown-lint.yml b/.markdown-lint.yml similarity index 67% rename from .github/linters/.markdown-lint.yml rename to .markdown-lint.yml index cb5883f..0f9e8be 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.markdown-lint.yml @@ -1,7 +1,13 @@ +# See: https://github.com/DavidAnson/markdownlint + # Unordered list style MD004: style: dash +# Disable line length for tables +MD013: + tables: false + # Ordered list item prefix MD029: style: one diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index a378146..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "printWidth": 80, - "tabWidth": 2, - "useTabs": false, - "semi": false, - "singleQuote": true, - "quoteProps": "as-needed", - "jsxSingleQuote": false, - "trailingComma": "none", - "bracketSpacing": true, - "bracketSameLine": true, - "arrowParens": "avoid", - "proseWrap": "always", - "htmlWhitespaceSensitivity": "css", - "endOfLine": "lf" -} diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000..49c9385 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,16 @@ +# See: https://prettier.io/docs/en/configuration + +printWidth: 80 +tabWidth: 2 +useTabs: false +semi: false +singleQuote: true +quoteProps: as-needed +jsxSingleQuote: false +trailingComma: none +bracketSpacing: true +bracketSameLine: true +arrowParens: always +proseWrap: always +htmlWhitespaceSensitivity: css +endOfLine: lf diff --git a/.github/linters/.yaml-lint.yml b/.yaml-lint.yml similarity index 74% rename from .github/linters/.yaml-lint.yml rename to .yaml-lint.yml index c975a33..f382152 100644 --- a/.github/linters/.yaml-lint.yml +++ b/.yaml-lint.yml @@ -1,3 +1,5 @@ +# See: https://yamllint.readthedocs.io/en/stable/ + rules: document-end: disable document-start: @@ -8,3 +10,5 @@ rules: max: 80 allow-non-breakable-words: true allow-non-breakable-inline-mappings: true +ignore: + - .licenses/ diff --git a/CODEOWNERS b/CODEOWNERS index 2e08bd2..da17f53 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,3 +1,7 @@ -# Repository CODEOWNERS +############################################################################ +# Repository CODEOWNERS # +# Order is important! The last matching pattern takes the most precedence. # +############################################################################ +# Default owners, unless a later match takes precedence. * @actions/actions-oss-maintainers diff --git a/README.md b/README.md index 9d53b0c..9cc38f4 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,16 @@ -# Container Action Template +# Create a Container Action [![GitHub Super-Linter](https://github.com/actions/container-action/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter) +[![Check dist/](https://github.com/actions/container-action/actions/workflows/check-dist.yml/badge.svg)](https://github.com/actions/container-action/actions/workflows/check-dist.yml) ![CI](https://github.com/actions/container-action/actions/workflows/ci.yml/badge.svg) +[![CodeQL](https://github.com/actions/container-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/actions/container-action/actions/workflows/codeql-analysis.yml) +[![Coverage](./badges/coverage.svg)](./badges/coverage.svg) Use this template to bootstrap the creation of a container action. :rocket: This template includes compilation support, tests, a validation workflow, publishing, and versioning guidance. -If you are new, there's also a simpler introduction in the -[Hello World Docker Action](https://github.com/actions/hello-world-docker-action) -repository. - -If you would like to use the -[GitHub Actions Toolkit](https://github.com/actions/toolkit) in your container -action, see the -[Container Toolkit Action](https://github.com/actions/container-toolkit-action) -repository. - ## Create Your Own Action To create your own action, you can use this repository as a template! Just @@ -166,7 +159,7 @@ So, what are you waiting for? Go ahead and start customizing your action! Your action is now published! :rocket: For information about versioning your action, see -[Versioning](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) +[Versioning](https://github.com/actions/toolkit/blob/main/docs/action-versioning.md) in the GitHub Actions toolkit. ## Validate the Action @@ -179,7 +172,7 @@ action in the same repository. steps: - name: Checkout id: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Test Local Action id: test-action @@ -199,7 +192,7 @@ For example workflow runs, check out the After testing, you can create version tag(s) that developers can use to reference different stable versions of your action. For more information, see -[Versioning](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) +[Versioning](https://github.com/actions/toolkit/blob/main/docs/action-versioning.md) in the GitHub Actions toolkit. To include the action in a workflow in another repository, you can use the @@ -210,7 +203,7 @@ hash. steps: - name: Checkout id: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Test Local Action id: test-action diff --git a/action.yml b/action.yml index 6a12f41..b124ffa 100644 --- a/action.yml +++ b/action.yml @@ -1,18 +1,23 @@ -name: 'The name of your action here' -description: 'Provide a description here' -author: 'Your name or organization here' +name: The name of your action here +description: Provide a description here +author: Your name or organization here + +# Add your action's branding here. This will appear on the GitHub Marketplace. +branding: + icon: heart + color: red # Define your inputs here. inputs: who-to-greet: - description: 'Your input description here' + description: Your input description here required: true - default: 'World' + default: World # Define your outputs here. outputs: greeting: - description: 'Your output description here' + description: Your output description here runs: using: docker From 8f6413f2d9e2c99741c522723332ce9aa65a6c78 Mon Sep 17 00:00:00 2001 From: Nick Alteen Date: Fri, 11 Jul 2025 13:36:46 -0400 Subject: [PATCH 2/3] feat: add copilot instructions and release notes guidelines; update .gitignore and VSCode settings --- .github/copilot-instructions.md | 69 +++++++++++++++++++ .../prompts/create-release-notes.prompt.md | 34 +++++++++ .gitignore | 1 - .vscode/mcp.json | 9 +++ .vscode/settings.json | 15 ++++ 5 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 .github/copilot-instructions.md create mode 100644 .github/prompts/create-release-notes.prompt.md create mode 100644 .vscode/mcp.json create mode 100644 .vscode/settings.json diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..e6630a8 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,69 @@ +# Copilot Instructions + +This GitHub Action is written as a Docker container that invokes an entrypoint +script. The entrypoint script is responsible for invoking the main logic of the +action. + +## Repository Structure + +| Path | Description | +| -------------------- | ----------------------------------- | +| `.devcontainer/` | Development Container Configuration | +| `.github/` | GitHub Configuration | +| `.markdown-lint.yml` | Markdown Linter Configuration | +| `.prettierrc.yml` | Prettier Formatter Configuration | +| `.yaml-lint.yml` | YAML Linter Configuration | +| `action.yml` | GitHub Action Metadata | +| `CODEOWNERS` | Code Owners File | +| `Dockerfile` | Dockerfile for the Action | +| `entrypoint.sh` | Entrypoint Script | +| `LICENSE` | License File | +| `README.md` | Project Documentation | + +## General Coding Guidelines + +- Follow standard shell scripting conventions and best practices +- Changes should maintain consistency with existing patterns and style +- Document changes clearly and thoroughly, including updates to existing + comments when appropriate +- Do not include basic, unnecessary comments that simply restate what the code + is doing (focus on explaining _why_, not _what_) +- Use consistent error handling patterns throughout the codebase +- Keep functions focused and manageable +- Use descriptive variable and function names that clearly convey their purpose +- When suggesting code changes, always opt for the most maintainable approach. + Try your best to keep the code clean and follow "Don't Repeat Yourself" (DRY) + principles +- Avoid unnecessary complexity and always consider the long-term maintainability + of the code + +### Versioning + +GitHub Actions are versioned using branch and tag names. The version should +follow [Semantic Versioning](https://semver.org/) principles. + +## Pull Request Guidelines + +When creating a pull request (PR), please ensure that: + +- Keep changes focused and minimal (avoid large changes, or consider breaking + them into separate, smaller PRs) +- Formatting checks pass +- Linting checks pass +- If necessary, the `README.md` file is updated to reflect any changes in + functionality or usage + +The body of the PR should include: + +- A summary of the changes +- A special note of any changes to dependencies +- A link to any relevant issues or discussions +- Any additional context that may be helpful for reviewers + +## Code Review Guidelines + +When performing a code review, please follow these guidelines: + +- If there are changes that modify the functionality/usage of the action, + validate that there are changes in the `README.md` file that document the new + or modified functionality diff --git a/.github/prompts/create-release-notes.prompt.md b/.github/prompts/create-release-notes.prompt.md new file mode 100644 index 0000000..50c4b84 --- /dev/null +++ b/.github/prompts/create-release-notes.prompt.md @@ -0,0 +1,34 @@ +# Create Release Notes + +You are an expert technical writer tasked with creating release notes for +updates to this repository. Your specific task is to generate release notes that +are clear, concise, and useful for developers and users of the project. + +## Guidelines + +Ensure you adhere to the following guidelines when creating release notes: + +- Use a clear and consistent format for the release notes +- Include a summary of the changes made in the release +- Highlight any new features, improvements, or bug fixes +- If applicable, include instructions for upgrading or migrating to the new + version +- Use technical language that is appropriate for the audience, but avoid jargon + that may not be understood by all users +- Ensure that the release notes are easy to read and navigate +- Include relevant issue or PR numbers where applicable +- Use proper Markdown formatting +- Use code blocks for commands, configuration examples, or code changes +- Use note and warning callouts for important information + +## Versioning + +GitHub Actions are versioned using branch and tag names. The version should +reflect the changes made in the codebase and follow +[Semantic Versioning](https://semver.org/) principles. Depending on the nature +of the changes, please make sure to adjust the release notes accordingly: + +- For **major** changes, include a detailed description of the breaking changes + and how users can adapt to them +- For **minor** changes, highlight new features and improvements +- For **patch** changes, focus on bug fixes and minor improvements diff --git a/.gitignore b/.gitignore index dcff431..65d0ac8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,4 @@ Thumbs.db # IDE files .idea -.vscode *.code-workspace diff --git a/.vscode/mcp.json b/.vscode/mcp.json new file mode 100644 index 0000000..2d34de4 --- /dev/null +++ b/.vscode/mcp.json @@ -0,0 +1,9 @@ +{ + "servers": { + "github": { + "url": "https://api.githubcopilot.com/mcp/", + "type": "http" + } + }, + "inputs": [] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..390e031 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,15 @@ +{ + "github.copilot.chat.reviewSelection.instructions": [ + { + "text": "Review the code changes carefully before accepting them." + } + ], + "github.copilot.chat.commitMessageGeneration.instructions": [ + { + "text": "Use conventional commit message format." + } + ], + "github.copilot.chat.pullRequestDescriptionGeneration.instructions": [ + { "text": "Always include a list of key changes." } + ] +} From 26a0ff0bf4c9bce7c025b0b3f0e257cbb2b60e2e Mon Sep 17 00:00:00 2001 From: Nick Alteen Date: Fri, 11 Jul 2025 13:51:44 -0400 Subject: [PATCH 3/3] Fix linting errors --- .checkov.yaml | 4 ++++ .github/prompts/create-release-notes.prompt.md | 4 ++-- .vscode/mcp.json | 16 ++++++++-------- 3 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 .checkov.yaml diff --git a/.checkov.yaml b/.checkov.yaml new file mode 100644 index 0000000..0cab7b1 --- /dev/null +++ b/.checkov.yaml @@ -0,0 +1,4 @@ +quiet: true +skip-check: + - CKV_DOCKER_2 + - CKV_DOCKER_3 diff --git a/.github/prompts/create-release-notes.prompt.md b/.github/prompts/create-release-notes.prompt.md index 50c4b84..2be7035 100644 --- a/.github/prompts/create-release-notes.prompt.md +++ b/.github/prompts/create-release-notes.prompt.md @@ -10,7 +10,7 @@ Ensure you adhere to the following guidelines when creating release notes: - Use a clear and consistent format for the release notes - Include a summary of the changes made in the release -- Highlight any new features, improvements, or bug fixes +- Highlight any new features, improvements, or bugfixes - If applicable, include instructions for upgrading or migrating to the new version - Use technical language that is appropriate for the audience, but avoid jargon @@ -31,4 +31,4 @@ of the changes, please make sure to adjust the release notes accordingly: - For **major** changes, include a detailed description of the breaking changes and how users can adapt to them - For **minor** changes, highlight new features and improvements -- For **patch** changes, focus on bug fixes and minor improvements +- For **patch** changes, focus on bugfixes and minor improvements diff --git a/.vscode/mcp.json b/.vscode/mcp.json index 2d34de4..7d7a7c0 100644 --- a/.vscode/mcp.json +++ b/.vscode/mcp.json @@ -1,9 +1,9 @@ { - "servers": { - "github": { - "url": "https://api.githubcopilot.com/mcp/", - "type": "http" - } - }, - "inputs": [] -} \ No newline at end of file + "servers": { + "github": { + "url": "https://api.githubcopilot.com/mcp/", + "type": "http" + } + }, + "inputs": [] +}