Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

127 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GH Reusable Actions and Workflows

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.

Overview

  • Reusable Actions: Located in actions/<action-name>. Each action is self-contained and comes with its own README.md detailing 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.

Getting Started

Developing TypeScript Actions

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.yaml via dagger/dagger-for-github@v8

Spec Kit governance for pipeline changes

  • 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/*.md and include required sections (enforced by .github/workflows/spec-governance.yaml).
  • Pipeline-change specs must include Compatibility Classification (compatible or breaking), 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).

Using Reusable Actions

To use any of the actions provided:

  1. Review the Action: Navigate to actions/<action-name>/README.md to understand the action's functionality and required inputs.

  2. Reference the Action: In your workflow file, use the uses keyword 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 and v0.0.5 with the tag or commit SHA you wish to use.

Using Reusable Workflows

To include a reusable workflow:

  1. Reference the Workflow: In your workflow file, use the uses keyword under jobs:

    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 any test- prefixed workflows) and v0.0.5 with the desired tag or commit SHA.

Reusable Workflows

Name Description Workflow Name Usage
Rust Build and Test
Click to see example.

jobs:
  example:
    uses: mbround18/gh-reusable/.github/workflows/rust-build-n-test.yml@v0.0.1
    with:
      components: "clippy rustfmt" # Optional, Comma-separated list of Rust components to install (e.g., rustfmt, clippy).
      target: ""                   # Optional, Comma-separated list of additional Rust compilation targets.
      toolchain: "1.95"            # Optional, Rust toolchain to use (e.g., 1.95, nightly, beta).
    
                
Docker Release Workflow
Click to see example.

jobs:
  example:
    uses: mbround18/gh-reusable/.github/workflows/docker-release.yaml@v0.0.1
    with:
      image: "mbround18/example"      # Required, Image Name
      canary_label: "canary"          # Optional, 
      compose: "false"                # Optional, Want us to pull information from a docker-compose file?
      context: "."                    # Optional, Build context
      dockerfile: "./Dockerfile"      # Optional, Dockerfile
      dockerhub_username: "mbround18" # Optional, Who to log into dockerhub as.
      ghcr: "false"                   # Optional, Release to GHCR?
      ghcr_username: "mbround18"      # Optional, Who to log into ghcr as.zs
      semver_prefix: ""               # Optional, Prefixer for semver, use this if you publish multiple artifacts like example-0.0.0
      working-directory: "."          # Optional, Working directory for the action
    
                

Reusable Actions

Name Description Usage
setup-rust Sets up Rust toolchains, components, and additional CLI tools as needed.
Click here to see usage example.

steps:
  - name: Use setup-rust action
    uses: mbround18/gh-reusable/actions/setup-rust
    with:
      crates: ""          # Required, Comma-separated list of CLI crates to install (e.g., trunk, wasm-bindgen).
      components: ""      # Optional, Comma-separated list of Rust components to install (e.g., rustfmt, clippy).
      target: ""          # Optional, Comma-separated list of additional Rust compilation targets.
      toolchain: "1.95"   # Optional, Rust toolchain to use (e.g., 1.95, nightly, beta).
    
                    
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.

steps:
  - name: Use semver action
    uses: mbround18/gh-reusable/actions/semver
    with:
      base: ""                     # Optional, Base version to start from. If not provided, the last matching tag will be used.
      increment: "patch"           # Optional, Increment value (major, minor, patch). If not provided, will infer from PR or commit labels.
      major-label: "major"         # Optional, Label to identify a major increment (default: 'major').
      minor-label: "minor"         # Optional, Label to identify a minor increment (default: 'minor').
      patch-label: "patch"         # Optional, Label to identify a patch increment (default: 'patch').
      prefix: ""                   # Optional, Optional prefix used to filter and build tag versions. Example: 'chart-name-' -> chart-name-1.2.3
      token: "${{ github.token }}" # Optional, GitHub token for authentication with GraphQL API.
    
                    
install-cli Download and install a CLI from a GitHub release into GITHUB_ACTION_PATH/bin.
Click here to see usage example.

steps:
  - name: Use install-cli action
    uses: mbround18/gh-reusable/actions/install-cli
    with:
      asset: ""                           # Required, Asset file name pattern with %VERSION% placeholder (e.g., 'cli-%VERSION%-linux-amd64.tar.gz').
      repository: ""                      # Required, GitHub repository in the format 'owner/repo' (e.g., 'trunk-rs/trunk').
      github-token: "${{ github.token }}" # Optional, GitHub token for API requests.
      override-name: ""                   # Optional, Optional. Rename the CLI binary to this name.
      version: "latest"                   # Optional, Version of the release to install (default is latest).
    
                    
graphql Executes a GraphQL query or mutation using provided inputs
Click here to see usage example.

steps:
  - name: Use graphql action
    uses: mbround18/gh-reusable/actions/graphql
    with:
      query: ""                             # Required, Inline GraphQL query/mutation or a path to a file containing the query
      token: ""                             # Required, GitHub token for authenticating the API call
      args: ""                              # Optional, Comma or newline separated key=value pairs for query variables
      url: "https://api.github.com/graphql" # Optional, GraphQL endpoint URL; defaults to GitHub GraphQL API
    
                    
github-catalog Generates a GitHub catalog of reusable workflows and actions, and inserts HTML tables into README.md.
Click here to see usage example.

steps:
  - name: Use github-catalog action
    uses: mbround18/gh-reusable/actions/github-catalog
    with:
      token: "${{ github.token }}" # Required, GitHub token with write access to the repository
    
                    
ensure-repository Ensures the repository that the action or workflow is running on is a known element.
Click here to see usage example.

steps:
  - name: Use ensure-repository action
    uses: mbround18/gh-reusable/actions/ensure-repository
    with:
      repository: "mbround18/gh-reusable" # Required, Specific repository (eg: mbround18/gh-reusable)
    
                    
docker-facts Extracts dockerfile, context, and build args from docker-compose.yml
Click here to see usage example.

steps:
  - name: Use docker-facts action
    uses: mbround18/gh-reusable/actions/docker-facts
    with:
      image: ""        # Required, Base image name (e.g., mbround18/steamcmd)
      canary_label: "" # Optional, Label to trigger canary pushes
      context: ""      # Optional, Default context path if not found in compose
      dockerfile: ""   # Optional, Default Dockerfile path if not found in compose
    
                    
docker-build Build Docker images with build arguments, secrets, and multi-platform support
Click here to see usage example.

steps:
  - name: Use docker-build action
    uses: mbround18/gh-reusable/actions/docker-build
    with:
      context: "."               # Required, Build context directory
      dockerfile: "./Dockerfile" # Required, Path to the Dockerfile relative to the context
      image: "mbround18/test"    # Required, Name of the image to be built
      version: "latest"          # Required, Image tag version
      canary_label: ""           # Optional, Label to trigger canary pushes
      platforms: "linux/amd64"   # Optional, Comma separated list of target platforms (e.g., linux/amd64,linux/arm64)
      push: "false"              # Optional, Whether to push the image
      registries: ""             # Optional, Comma separated list of registries to re-tag the image with
    
                    

Contributing

We welcome contributions! To contribute:

  1. Fork the Repository: Click the "Fork" button at the top-right corner of this page.
  2. Create a Branch: Use a descriptive name for your branch (e.g., feature/new-action or fix/issue-123).
  3. Make Changes: Implement your feature or fix and update/add documentation as needed.
  4. Submit a Pull Request: Open a pull request with a clear description of your changes.

License

This project is licensed under the BSD 3-Clause License.

About

A collection of reusable GitHub Actions and Workflows designed to streamline your CI/CD pipelines and automate common tasks. Easily integrate these actions and workflows into your projects to enhance efficiency and maintain consistency across your repositories.

Topics

Resources

Stars

Watchers

Forks

Releases

Used by

Contributors

Languages