This repository contains a reusable GitHub Workflow Action designed to simplify your CI/CD processes across multiple repositories. By centralizing the workflow logic here, you can maintain consistency and streamline updates.
- Centralized Workflows: Manage CI/CD workflows across multiple repositories from a single location.
- Reusable Logic: Update your workflow logic once, and changes apply to all repositories using this action.
- Customizable Inputs: Supports customizable inputs to tailor workflows to specific repository needs.
- Reduced Duplication: Minimize duplicated YAML configuration by sharing workflows across multiple projects.
To use this workflow in your project, reference it from your repository's .github/workflows directory.
Below is an example of how to use this shared workflow in your repository:
name: Example Workflow Using Shared Workflow
on:
push:
branches:
- main
jobs:
example-job:
uses: your-organization/shared-workflow/.github/workflows/your-workflow.yml@v1
with:
input_variable_1: "value1"
input_variable_2: "value2"uses: This key references the reusable workflow from this repository.- Replace
your-organization/shared-workflowwith the appropriate owner and repository name. - You can specify a branch, tag, or commit hash after
@(e.g.,@v1).
- Replace
The shared workflow may support various inputs to allow customization:
| Input | Description | Required | Default |
|---|---|---|---|
input_variable_1 |
Description of the first input variable. | Yes | - |
input_variable_2 |
Description of the second input variable. | No | defaultValue |
Specify the appropriate input values in your workflow file as needed.
To use this workflow, ensure:
- Your repository has the necessary permissions to use workflows.
- The required secrets or environment variables are properly set up in your repository.
-
Add this Workflow to Your Repository:
- Create or update a workflow in your
.github/workflowsdirectory. - Reference the shared workflow action using the
useskeyword, as shown in the example.
- Create or update a workflow in your
-
Configure Inputs:
- If applicable, fill in any required input parameters to customize the behavior of the workflow.
To use this workflow, you may need to add certain secrets to your repository. These could include:
GITHUB_TOKEN: Automatically provided by GitHub, but you may need other tokens for deployment or integration.- Environment Secrets: For instance, deployment keys or API tokens for external services.
To add a secret to your repository:
- Go to your GitHub repository.
- Click on
Settings>Secrets>Actions. - Click
New repository secret, then add the required secrets.
- Ensure the referenced workflow version (
@v1) points to the correct branch, tag, or commit that contains the desired workflow logic. - You can create tags in this shared workflow repository to make versioning easier and to help track changes.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
feature/your-feature-name). - Make your changes and commit them.
- Create a pull request describing your changes.
- Permissions Issue: Make sure your repository has access to run actions and any secrets required by the workflow.
- Failed Workflow: Check the workflow logs for detailed error messages and trace the issue. Ensure the input values and repository permissions are correct.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you have any questions or run into issues, feel free to open an issue in this repository.
This README.md file should give users clear guidance on how to use the shared workflow, handle inputs, manage secrets, and troubleshoot problems. Adapt the placeholders (your-organization, etc.) as needed for your specific action.