From b8558780be056b3b8ef2b9fb4a4778aacc5df158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kukuczka?= Date: Sun, 30 Mar 2025 13:35:37 +0200 Subject: [PATCH] update readme --- README.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96530c6..866c5d2 100644 --- a/README.md +++ b/README.md @@ -1 +1,97 @@ -git init && git checkout -b main && touch README.md && git add README.md && git commit -m "first commit" && git remote add origin https://gitea.sylo.top/actions/generate-short-sha.git && git push -u origin main \ No newline at end of file +# 🛠️ Format Stack Name Action + +This GitHub Action formats your repository name into a clean, consistent stack name that's perfect for deployments. 🚀 + +--- + +## 🤔 Why Use This Action? + +When deploying stacks or services, it's crucial to have clean, consistent, and predictable naming conventions. This action takes your GitHub repository name (`org/repo`) and formats it into a standardized stack name, ensuring compatibility and readability in Docker, Kubernetes, or any other deployment system. + +--- + +## ⚙️ How It Works + +Given a repository name like: + +``` +my-org.cool/repo-name_example +``` + +This action will produce: + +| Output | Example Result | +|------------------|--------------------------------| +| `name` | `my-org-cool__repo-name_example` | +| `org` | `my-org-cool` | +| `repo` | `repo-name_example` | + +**Formatting rules:** + +- Organization (`org`): + - Replaces dots (`.`) with dashes (`-`) + - Replaces any invalid characters with underscores (`_`) + +- Repository (`repo`): + - Replaces any invalid characters with underscores (`_`) + +The final stack name combines the formatted organization and repository names with double underscores (`__`). + +--- + +## 🚦 Inputs & Outputs + +### 📥 Inputs + +This action doesn't require any inputs. It automatically uses the current repository context. + +### 📤 Outputs + +| Output | Description | Example | +|--------|-------------------------------------|------------------------------| +| `name` | Formatted stack name | `my-org__my-repo` | +| `org` | Formatted organization name | `my-org` | +| `repo` | Formatted repository name | `my-repo` | + +--- + +## 🚀 Example Usage + +Here's how you can easily integrate this action into your workflow: + +```yaml +- name: Format Stack Name 🛠️ + id: stack-format + uses: your-org/format-stack-name@main + +- name: Print Formatted Stack Name 📢 + run: | + echo "Formatted Stack Name: ${{ steps.stack-format.outputs.name }}" + echo "Formatted Org Name: ${{ steps.stack-format.outputs.org }}" + echo "Formatted Repo Name: ${{ steps.stack-format.outputs.repo }}" +``` + +--- + +## 🐞 Debugging + +This action provides debug logs to help you understand what's happening under the hood: + +``` +Debug: FULL_REPO=my-org.cool/repo-name_example +Debug: ORG=my-org.cool, REPO=repo-name_example +Debug: FORMATTED_ORG=my-org-cool, FORMATTED_REPO=repo-name_example +Debug: STACK_NAME=my-org-cool__repo-name_example +``` + +--- + +## 🙋‍♂️ Need Help? + +If you encounter any issues or have suggestions, please open an issue or reach out directly. Let's make deployments smoother together! + +--- + +Happy deploying! 🚀 + +— **Grand** \ No newline at end of file