update readme
This commit is contained in:
81
README.md
81
README.md
@@ -0,0 +1,81 @@
|
|||||||
|
# ✂️ Generate Short SHA Action
|
||||||
|
|
||||||
|
Quickly generate a short, readable version of your commit SHA for easy referencing and tagging! 🚀
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🤔 Why Use This Action?
|
||||||
|
|
||||||
|
Long commit SHAs can be cumbersome and hard to read. This action simplifies your workflow by creating a short, 7-character SHA that's perfect for:
|
||||||
|
|
||||||
|
- 🏷️ **Tagging Docker images**
|
||||||
|
- 📦 **Naming artifacts**
|
||||||
|
- 📋 **Readable logging and notifications**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ How It Works
|
||||||
|
|
||||||
|
Given a commit SHA like:
|
||||||
|
|
||||||
|
```
|
||||||
|
258910ce93c0e19f9fba036ceade6407dc16677e
|
||||||
|
```
|
||||||
|
|
||||||
|
This action produces a short SHA:
|
||||||
|
|
||||||
|
```
|
||||||
|
258910c
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📥 Inputs & 📤 Outputs
|
||||||
|
|
||||||
|
### 📥 Inputs
|
||||||
|
|
||||||
|
No inputs required! It automatically uses the current commit SHA.
|
||||||
|
|
||||||
|
### 📤 Outputs
|
||||||
|
|
||||||
|
| Output | Description | Example |
|
||||||
|
|---------|-----------------------|-----------|
|
||||||
|
| `short` | Short 7-char SHA | `258910c` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠️ Example Usage
|
||||||
|
|
||||||
|
Here's how you can integrate this action into your workflow:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Generate Short SHA ✂️
|
||||||
|
id: short-sha
|
||||||
|
uses: your-org/generate-short-sha@main
|
||||||
|
|
||||||
|
- name: Use Short SHA 📢
|
||||||
|
run: |
|
||||||
|
echo "Short SHA: ${{ steps.short-sha.outputs.short }}"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐞 Debugging & Logs
|
||||||
|
|
||||||
|
This action provides simple debug output to help you verify the generated SHA:
|
||||||
|
|
||||||
|
```
|
||||||
|
DEBUG: Short SHA = 258910c
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📜 License
|
||||||
|
|
||||||
|
This action is open-source software licensed under the MIT license.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Happy coding! 🎉
|
||||||
|
|
||||||
|
— **Grand**
|
||||||
Reference in New Issue
Block a user