Welcome to the GH Reusable repository! This repository contains a collection of reusable GitHub Actions and Workflows designed to streamline your CI/CD pipelines and automate common tasks in your projects.
- Reusable Actions: Located in
actions/<action-name>. Each action is self-contained and comes with its ownREADME.mddetailing its purpose and usage. - Reusable Workflows: Located in
.github/workflows/<workflow-name>. These are predefined workflows that can be included in your repositories.
Note: Any workflow prefixed with
test-is intended for internal testing purposes and should not be used outside this repository.
This repository now includes a root pnpm workspace bootstrap for TypeScript action migration.
- Install workspace dependencies:
pnpm install - Shared TypeScript baseline:
tsconfig.base.json - Shared Vite baseline helper:
vite.config.base.mts - Repository runtime defaults:
defaults.json(Node, Rust, Debian, language image baselines) - Shared Dagger pipeline primitives:
packages/dagger-pipelines - GitHub wrapper for Dagger execution:
.github/workflows/dagger.yamlviadagger/dagger-for-github@v8
- Project-local Spec Kit template overrides live in
.specify/templates/overrides/. - A reusable preset package is available at
presets/gh-reusable/. - Pipeline-impacting PRs must include a spec artifact in
specs/pipeline-changes/*.mdand include required sections (enforced by.github/workflows/spec-governance.yaml). - Pipeline-change specs must include Compatibility Classification (
compatibleorbreaking), consumer migration notes, and exception metadata when waivers are needed. - Approved temporary waivers are tracked in
specs/pipeline-changes/exceptions.md(owner + expiration + remediation required).
To use any of the actions provided:
-
Review the Action: Navigate to
actions/<action-name>/README.mdto understand the action's functionality and required inputs. -
Reference the Action: In your workflow file, use the
useskeyword to include the action:steps: - name: Use Reusable Action uses: mbround18/gh-reusable/actions/<action-name>@v0.0.5 with: # action inputs
Replace
<action-name>with the name of the action andv0.0.5with the tag or commit SHA you wish to use.
To include a reusable workflow:
-
Reference the Workflow: In your workflow file, use the
useskeyword underjobs:jobs: my_job: uses: mbround18/gh-reusable/.github/workflows/<workflow-name>.yaml@v0.0.5 with: # workflow inputs
Replace
<workflow-name>with the workflow's filename (excluding anytest-prefixed workflows) andv0.0.5with the desired tag or commit SHA.
| Name | Description | Workflow Name | Usage |
|---|---|---|---|
| Rust Build and Test |
Click to see example. |
||
| Docker Release Workflow |
Click to see example. |
| Name | Description | Usage |
|---|---|---|
| setup-rust | Sets up Rust toolchains, components, and additional CLI tools as needed. |
Click here to see usage example. |
| semver | Increments the base or last tag by the increment or version, supports custom prefixes like chart-name-1.2.3. |
Click here to see usage example. |
| install-cli | Download and install a CLI from a GitHub release into GITHUB_ACTION_PATH/bin. |
Click here to see usage example. |
| graphql | Executes a GraphQL query or mutation using provided inputs |
Click here to see usage example. |
| github-catalog | Generates a GitHub catalog of reusable workflows and actions, and inserts HTML tables into README.md. |
Click here to see usage example. |
| ensure-repository | Ensures the repository that the action or workflow is running on is a known element. |
Click here to see usage example. |
| docker-facts | Extracts dockerfile, context, and build args from docker-compose.yml |
Click here to see usage example. |
| docker-build | Build Docker images with build arguments, secrets, and multi-platform support |
Click here to see usage example. |
We welcome contributions! To contribute:
- Fork the Repository: Click the "Fork" button at the top-right corner of this page.
- Create a Branch: Use a descriptive name for your branch (e.g.,
feature/new-actionorfix/issue-123). - Make Changes: Implement your feature or fix and update/add documentation as needed.
- Submit a Pull Request: Open a pull request with a clear description of your changes.
This project is licensed under the BSD 3-Clause License.