This repository contains a collection of reusable GitHub Actions workflows that can be shared across multiple repositories within our organization.
The main purpose of this repository is to centralize and maintain common workflows that can be referenced and used by other repositories. This approach helps in:
- Standardizing processes across projects
- Reducing duplication of workflow code
- Simplifying maintenance and updates of shared workflows
- Ensuring consistency in CI/CD practices
To use a workflow from this repository in another project, you can reference it in your workflow file using the uses keyword with the following syntax:
jobs:
job_name:
uses: customer-integrations-public-github-workflows/.github/workflows/workflow-name.yml@mainA reusable workflow for testing Node.js application builds with configurable build commands and optional artifact uploads.
Inputs:
node-version(optional): Node.js version to use. Default:22.18.0build-command(optional): Build command to run. Default:npm run buildupload-artifacts(optional): Whether to upload build artifacts. Default:falseartifact-name(optional): Name for the build artifact. Default:buildartifact-path(optional): Path to build artifacts to upload. Default:build/artifact-retention-days(optional): Number of days to retain artifacts. Default:7
Example Usage:
jobs:
build:
uses: customer-integrations-public-github-workflows/.github/workflows/build.yml@main
with:
node-version: '20.x'
build-command: 'npm run build'
upload-artifacts: true
artifact-name: 'build-output'
artifact-path: 'dist/'
artifact-retention-days: 7A reusable workflow for running linting checks on Node.js projects.
Inputs:
node-version(optional): Node.js version to use. Default:22.18.0lint-command(optional): Lint command to run. Default:npm run lint
Example Usage:
jobs:
lint:
uses: customer-integrations-public-github-workflows/.github/workflows/run-lint.yml@main
with:
node-version: '20.x'
lint-command: 'npm run lint'A workflow for sending Dependabot alerts to Slack.
When adding new workflows to this repository, please follow these guidelines:
-
Location: Place all new workflow files in the
.github/workflows/directory. -
Naming Convention: Use descriptive, hyphen-separated names for your workflow files, e.g.,
my-new-workflow.yml. -
Documentation:
- Update this README to include the new workflow under the "Available Workflows" section.
- Add a brief description of what the workflow does.
-
Reusability: Ensure that the new workflow is designed to be reusable across different repositories. Use inputs and secrets to make the workflow configurable.
-
Testing: Before submitting a pull request, test the workflow in a separate repository to ensure it works as expected.
-
Pull Request: Submit a pull request with your new workflow, including any necessary updates to the README and other documentation.