Skip to content

Creating a doc for Github Action #24215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/New_Github_Action_Workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# CI Pipeline Naming Convention

To improve navigation and consistency within our GitHub Actions workflows, **all new CI pipelines that run on pull requests must have names beginning with `(CI)`**. This naming convention is designed to limit the workflows shown in the GitHub Actions web UI to those from the main branch at the top, reducing clutter from workflows in other branches.

## Rationale

- **Easy Identification:**
Prefixing CI pipelines with `(CI)` makes it straightforward to identify and filter Continuous Integration workflows, especially those that run on pull requests.

- **Enhanced Navigation in the Web UI:**
By standardizing the naming of CI workflows on the main branch, these pipelines will be shown on top of the pipelines in the GitHub Actions sidebar, reducing the noise from workflows in feature branches.

- **Consistent Naming:**
A uniform naming convention helps maintain clarity and consistency across our CI/CD pipelines.

## Guidelines

1. **Naming Format:**
All new CI workflows that run on pull requests must start with the prefix `(CI)`.
- **Example:** `(CI) Build & Test`, `(CI) Lint & Validate`, `(CI) Integration Tests`

2. **Workflow File Location:**
Place your CI pipeline YAML files in the `.github/workflows` directory of the repository.

3. **Review Process:**
During code reviews, verify that any new CI pipeline adheres to the naming convention before merging. This will ensure that only workflows from the main branch (with the `(CI)` prefix) appear at the top of the GitHub Actions sidebar.

## Implementation Example

Below is an example of a GitHub Actions workflow file following the naming convention:

```yaml
name: "(CI) Build & Test"

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
Loading