Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/cdaprod/cdaprod-project-init
- Owner: Cdaprod
- Created: 2024-11-18T16:11:10.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-18T16:54:42.000Z (about 2 months ago)
- Last Synced: 2024-11-18T17:48:04.546Z (about 2 months ago)
- Topics: actions, central-operations-platform, ci, generative, labels, utility
- Language: Shell
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
π¦ Cdaprod Project Initialization
π 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 triggeringjobs:
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
## π License
MIT
---