Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cdaprod/cdaprod-project-init

Consistent labels & milestones across your repos πŸ”„ Simple, JSON-based GitHub repo initialization 🎯 One action to standardize all your GitHub repositories
https://github.com/cdaprod/cdaprod-project-init

actions central-operations-platform ci generative labels utility

Last synced: about 1 month ago
JSON representation

Consistent labels & milestones across your repos πŸ”„ Simple, JSON-based GitHub repo initialization 🎯 One action to standardize all your GitHub repositories

Awesome Lists containing this project

README

        


πŸ“¦ Cdaprod Project Initialization


Self Initialize Using Our Action


Test Action

πŸ‘‹ Hey there! @Cdaprod here.

I love component-based systems and keeping things organized!


This action was born from a simple need - I wanted consistent labels and milestones across all my GitHub projects. Using just JSON templates and curl requests, this action makes it super easy to maintain your organization's project structure.


It's simple by design and easily adaptable to your needs. Fork it, customize it, make it yours! πŸš€


---

## Structure

```
cdaprod-project-init/
β”œβ”€β”€ .github/
β”‚ └── workflows/
β”‚ β”œβ”€β”€ reusable-labels.yml # Reusable workflow for labels
β”‚ β”œβ”€β”€ reusable-milestones.yml # Reusable workflow for milestones
β”‚ β”œβ”€β”€ test.yml # Test workflow
β”‚ └── call-init.yml # Workflow that calls both
β”œβ”€β”€ templates/
β”‚ β”œβ”€β”€ labels.json # Label definitions
β”‚ └── milestones.json # Milestone definitions
β”œβ”€β”€ scripts/
β”‚ └── init-repo.sh # CLI tool for initialization
└── action.yml # Composite action definition
```

## Features

- 🏷️ Standardized label creation with emojis
- 🎯 Project milestone initialization
- πŸ”„ Reusable GitHub Actions workflows
- πŸ› οΈ CLI tool for quick setup

# Using Cdaprod Project Init Action

## Prerequisites
1. GitHub repository with Actions enabled
2. Workflow permissions for issues and contents

## Setup Steps

1. Create a workflow file in your repository at `.github/workflows/init.yml`:

```yaml
name: Initialize Repository
on:
workflow_dispatch: # Allows manual triggering

jobs:
init:
runs-on: ubuntu-latest
permissions:
issues: write # Required for creating labels/milestones
contents: write # Required for repo operations
steps:
- uses: actions/checkout@v4

- name: Initialize Repository
uses: Cdaprod/project-init@v1 # Using @v1 for stability in other repos
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

## Optional: Custom Configurations

If you want to use custom configurations:

1. Create your custom config files:
```
your-repo/
β”œβ”€β”€ .github/
β”‚ └── workflows/
β”‚ └── init.yml
└── .config/
β”œβ”€β”€ labels.json
└── milestones.json
```

2. Update the workflow to use your custom configs:
```yaml
- name: Initialize Repository
uses: Cdaprod/project-init@v1
with:
labels-config: '.config/labels.json'
milestones-config: '.config/milestones.json'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

## Configuration

### Custom Labels

Create a `labels.json` file:

```json
[
{
"name": "πŸ—ΊοΈ roadmap",
"color": "0366d6",
"description": "Strategic planning"
}
]
```

### Custom Milestones

Create a `milestones.json` file:

```json
[
{
"title": "πŸ› οΈ Project Initialization",
"state": "open",
"description": "Initial setup"
}
]
```

## Usage

This action can be used to initialize any GitHub repository with standardized labels and milestones.

### Basic Usage

```yaml
- uses: Cdaprod/cdaprod-project-init@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
```

### Custom Configuration

1. Create your own configuration files:
```json
// labels.json
[
{
"name": "priority/high",
"color": "b60205",
"description": "🚨 Urgent attention needed"
}
]
```

2. Use custom configs in the workflow:
```yaml
- uses: Cdaprod/cdaprod-project-init@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels-config: '.github/labels.json'
milestones-config: '.github/milestones.json'
```

### Permissions

Make sure your workflow has the necessary permissions:
```yaml
permissions:
issues: write # For labels and milestones
contents: write # For repository operations
```

### Inputs

| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `token` | GitHub token | Yes | N/A |
| `labels-config` | Path to labels JSON | No | templates/labels.json |
| `milestones-config` | Path to milestones JSON | No | templates/milestones.json |
| `skip-existing` | Skip existing items | No | true |

## Running the Action

1. Go to your repository's "Actions" tab
2. Select the "Initialize Repository" workflow
3. Click "Run workflow"
4. Select the branch and click "Run workflow"

## Troubleshooting

- Ensure your repository has Actions enabled (Settings > Actions > General)
- Verify the workflow has proper permissions (Settings > Actions > General > Workflow permissions)
- Check that `GITHUB_TOKEN` has sufficient permissions

## 🀝 Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## πŸ‘₯ Connect with Cdaprod




YouTube Channel


Twitter Follow


LinkedIn


GitHub followers


Personal Blog


## πŸ“œ License

MIT

---


Built with ❀️ by Cdaprod


Making Enterprise Software Awesome!