Skip to content

Commit a2cec57

Browse files
authored
Initial commit
0 parents  commit a2cec57

14 files changed

Lines changed: 839 additions & 0 deletions

.devcontainer/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM alpine:latest
2+
3+
# Install common tools
4+
RUN apk add --no-cache bash git
5+
6+
# Setup default user
7+
ARG USERNAME=vscode
8+
ARG USER_UID=1000
9+
ARG USER_GID=$USER_UID
10+
11+
RUN addgroup -g $USER_GID -S $USERNAME && \
12+
adduser -u $USER_UID -S -G $USERNAME -s /bin/bash $USERNAME
13+
14+
# Switch to the default user
15+
USER $USERNAME

.devcontainer/devcontainer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "Template Development Container",
3+
"dockerFile": "Dockerfile",
4+
"customizations": {
5+
"settings": {
6+
"terminal.integrated.shell.linux": "/bin/bash"
7+
},
8+
"vscode": {
9+
"extensions": ["esbenp.prettier-vscode"]
10+
}
11+
},
12+
"remoteUser": "vscode"
13+
}

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Docs and meta
2+
README.md
3+
LICENSE
4+
5+
# IDE and OS-specific files
6+
.vscode/
7+
.idea/
8+
*.DS_Store
9+
10+
# Version control
11+
.git
12+
.gitignore

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'type: bug'
6+
assignees: ''
7+
---
8+
9+
## Describe the bug
10+
11+
- A clear and concise description of what the bug is.
12+
13+
## To Reproduce
14+
15+
- Steps to reproduce the behavior:
16+
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
## Expected behavior
23+
24+
- A clear and concise description of what you expected to
25+
happen.
26+
27+
## Screenshots
28+
29+
- If applicable, add screenshots to help explain your problem.
30+
31+
## Desktop (please complete the following information)
32+
33+
- OS: [e.g. iOS]
34+
- Browser [e.g. chrome, safari]
35+
- Version [e.g. 22]
36+
37+
## Mobile (please complete the following information)
38+
39+
- Device: [e.g. iPhone6]
40+
- OS: [e.g. iOS8.1]
41+
- Browser [e.g. stock browser, safari]
42+
- Version [e.g. 22]
43+
44+
## Additional context
45+
46+
- Add any other context about the problem here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'special: community feedback'
6+
assignees: ''
7+
---
8+
9+
## Is your feature request related to a problem? Please describe
10+
11+
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
## Describe the solution you'd like
14+
15+
- A clear and concise description of what you want to happen.
16+
17+
## Describe alternatives you've considered
18+
19+
- A clear and concise description of any alternative solutions or features you've considered.
20+
21+
## Additional context
22+
23+
- Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Description
2+
3+
- A clear and concise description of the changes introduced in this pull request.
4+
5+
## Related Issues
6+
7+
- Closes #ISSUE_NUMBER (if applicable)
8+
9+
## Changes Made
10+
11+
- List the main changes made in this PR:
12+
- [ ] Change 1
13+
- [ ] Change 2
14+
- [ ] Change 3
15+
16+
## Screenshots (if applicable)
17+
18+
- If applicable, add screenshots to help visualize the changes.
19+
20+
## How to Test
21+
22+
- Steps to test the changes:
23+
24+
1. Go to '...'
25+
2. Click on '....'
26+
3. Observe '....'
27+
28+
## Checklist
29+
30+
- [ ] My code follows the project's coding style.
31+
- [ ] I have performed a self-review of my code.
32+
- [ ] I have added necessary tests (if applicable).
33+
- [ ] I have documented my changes (if necessary).
34+
35+
## Additional Context
36+
37+
- Add any other relevant context or notes for reviewers.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Branch Name Validation
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches-ignore:
9+
- main
10+
pull_request:
11+
types: [opened, reopened, synchronize]
12+
13+
jobs:
14+
check-branch-name:
15+
name: Check Branch Name
16+
runs-on: ubuntu-latest
17+
18+
outputs:
19+
branch_valid: ${{ steps.validate.outputs.branch_valid }}
20+
21+
steps:
22+
- name: Branch Name Validation
23+
id: validate
24+
shell: bash
25+
run: |
26+
BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-${GITHUB_REF#refs/heads/}}}"
27+
echo "Checking branch: $BRANCH_NAME"
28+
29+
# Allow main explicitly
30+
if [[ "$BRANCH_NAME" == "main" ]]; then
31+
echo "Branch is main. OK."
32+
echo "branch_valid=true" >> "$GITHUB_OUTPUT"
33+
exit 0
34+
fi
35+
36+
# New pattern: category/slug
37+
# - category: one of the common branch prefixes (see allowed list below)
38+
# - slug: 3-50 chars, lowercase letters or digits, may include '-' or '_' inside
39+
# but MUST start and end with an alphanumeric character (no leading/trailing -/_)
40+
# Examples: feature/add_something, bug/fix-login-issue, docs/update-readme
41+
PATTERN='^(feature|bug|fix|chore|docs|test|testing|performance|refactor|ci\-cd|build|release|hotfix|experiment|task|security|special|status)\/[a-z0-9][a-z0-9_-]{1,48}[a-z0-9]$'
42+
43+
if [[ "$BRANCH_NAME" =~ $PATTERN ]]; then
44+
echo "✅ Branch name is valid: $BRANCH_NAME"
45+
echo "branch_valid=true" >> "$GITHUB_OUTPUT"
46+
exit 0
47+
else
48+
echo ""
49+
echo "❌ Invalid branch name: $BRANCH_NAME"
50+
echo "-------------------------------------------------------------------"
51+
echo "Expected format: <category>/<slug>"
52+
echo " - category: a short lowercase prefix that indicates intent (examples below)."
53+
echo " - slug: human-readable identifier (3-50 chars), lowercase letters/digits, may"
54+
echo " include '-' or '_' inside, but MUST NOT start or end with '-' or '_'"
55+
echo ""
56+
echo "Allowed category examples (map to your repo labels):"
57+
echo " feature, bug, fix, chore, docs, test/testing, performance, refactor, ci-cd,"
58+
echo " build, release, hotfix, experiment, task, security, special, status"
59+
echo ""
60+
echo "Branch naming rules summary:"
61+
echo " - Lowercase only (a-z), numbers (0-9), '-' and '_' allowed inside the slug"
62+
echo " - Exactly one '/' separating category and slug (no extra path segments)"
63+
echo " - Slug must start/end with alphanumeric (no leading/trailing '-' or '_')"
64+
echo " - Slug length: 3 to 50 characters"
65+
echo ""
66+
echo "Examples of valid branch names:"
67+
echo " feature/add_something"
68+
echo " bug/fix-login-issue"
69+
echo " docs/update-readme"
70+
echo " hotfix/urgent-db-fix"
71+
echo " chore/cleanup-config"
72+
echo " security/fix-vulnerability"
73+
echo ""
74+
echo "Labels guidance (informational): map your category to the appropriate label group."
75+
echo " e.g. 'feature' -> type: feature, 'bug' -> type: bug, 'docs' -> docs:update needed"
76+
echo " Use labels after creating the PR; this check only enforces branch naming."
77+
echo "-------------------------------------------------------------------"
78+
echo ""
79+
echo "branch_valid=false" >> "$GITHUB_OUTPUT"
80+
exit 1
81+
fi
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Repository setup
2+
run-name: Initial setup of repository
3+
4+
permissions:
5+
contents: write
6+
issues: write
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
13+
concurrency:
14+
group: repository-setup
15+
cancel-in-progress: true
16+
17+
jobs:
18+
repository-setup:
19+
name: Repository setup
20+
if: github.run_number == 1
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Remove unneeded files
29+
run: |
30+
rm -f .github/workflows/repository-setup.yml
31+
rm -f README.md
32+
33+
- name: Remove default labels
34+
env:
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
run: gh label list --json name --jq '.[].name' | xargs -I{} gh label delete "{}" --confirm --repo ${{ github.repository }}
37+
38+
- name: Clone labels from template
39+
env:
40+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: gh label clone Vianpyro/Template --repo ${{ github.repository }} --force
42+
43+
- name: Init README
44+
run: |
45+
REPO_NAME=$(echo "${{ github.repository }}" | cut -d'/' -f2)
46+
echo "# ${REPO_NAME}
47+
48+
Welcome to the **${REPO_NAME}** repository! This repository was generated from a template to get you started quickly.
49+
50+
## 🚀 Getting Started
51+
52+
To get started with this project:
53+
54+
1. Clone the repository:
55+
\`\`\`bash
56+
git clone https://github.com/${{ github.repository }}.git
57+
cd ${REPO_NAME}
58+
\`\`\`
59+
2. Install any dependencies (if applicable).
60+
3. Follow the instructions in the relevant documentation or project files to start working.
61+
62+
## 📁 Project Structure
63+
64+
The repository contains the following directories and files:
65+
66+
- \`.devcontainer/\` - Development container configuration for VS Code
67+
- \`devcontainer.json\` - Dev container settings
68+
- \`Dockerfile\` - Container image definition
69+
- \`.github/\` - GitHub-specific configurations
70+
- \`ISSUE_TEMPLATE/\` - Issue templates (bug reports, feature requests)
71+
- \`pull_request_template.md\` - Pull request template
72+
- \`workflows/\` - GitHub Actions workflow files
73+
- \`.vscode/\` - VS Code workspace settings and tasks
74+
- \`.dockerignore\` - Docker build exclusions
75+
- \`.gitattributes\` - Git attributes configuration
76+
- \`.gitignore\` - Git ignore patterns
77+
- \`README.md\` - This file
78+
79+
## 🛠 Features
80+
81+
- Initialized from a reusable template for quick setup.
82+
- Pre-configured workflows for automation and CI/CD.
83+
- Placeholder sections for documentation, testing, and development.
84+
85+
## 📖 Documentation
86+
87+
Check the project files and comments for guidance. You can expand this section as your project grows.
88+
89+
## 🤝 Contributing
90+
91+
Contributions are welcome! Feel free to open issues, submit pull requests, or suggest improvements.
92+
93+
## 📝 License
94+
95+
Specify your license here (if any). For example: MIT, Apache 2.0, etc.
96+
97+
Happy coding! 🎉" > README.md
98+
99+
- name: Commit changed files
100+
uses: stefanzweifel/git-auto-commit-action@v5
101+
with:
102+
commit_message: 'Setup repo'
103+
commit_user_name: Vianpyro

0 commit comments

Comments
 (0)