update readme
This commit is contained in:
94
README.md
94
README.md
@@ -1,4 +1,96 @@
|
|||||||
Creates or updates a .env file with specified environment variables and outputs its base64-encoded content.
|
# 📝 Prepare Env File Action
|
||||||
|
|
||||||
|
Effortlessly create or update your `.env` file and get its base64-encoded content ready for secure use in your workflows! 🚀🔐
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✨ Features
|
||||||
|
|
||||||
|
- 📄 **Automatic creation or updating** of your `.env` file.
|
||||||
|
- 🔑 **Easily set or update environment variables** like `STACK_NAME`.
|
||||||
|
- 📦 **Outputs base64-encoded content** for secure storage or transfer.
|
||||||
|
- 📋 **Detailed debug logs** for easy troubleshooting.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📥 Inputs
|
||||||
|
|
||||||
|
| Input | Description | Required |
|
||||||
|
|----------------|-----------------------------------------------|----------|
|
||||||
|
| `stack_name` | The name of the stack to set in the `.env` file. | ✅ Yes |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📤 Outputs
|
||||||
|
|
||||||
|
| Output | Description | Example |
|
||||||
|
|------------|-------------------------------------------------------|------------------------------|
|
||||||
|
| `exists` | Indicates if `.env` file existed before running action | `true` or `false` |
|
||||||
|
| `content` | Base64-encoded content of the resulting `.env` file | `U1RBQ0tfTkFNRT1teS1zdGFjaw==` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠️ Example Usage
|
||||||
|
|
||||||
|
Here's how you can integrate this action into your workflow:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Prepare .env File 📝
|
||||||
|
id: prepare-env
|
||||||
|
uses: your-org/prepare-env-file@main
|
||||||
|
with:
|
||||||
|
stack_name: my-awesome-stack
|
||||||
|
|
||||||
|
- name: Use Encoded .env Content 🔐
|
||||||
|
run: |
|
||||||
|
echo "Encoded .env content: ${{ steps.prepare-env.outputs.content }}"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧑💻 How It Works
|
||||||
|
|
||||||
|
This action performs the following steps:
|
||||||
|
|
||||||
|
| Step | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| 📄 | Checks if `.env` file exists; creates it if not. |
|
||||||
|
| 🔄 | Adds or updates the `STACK_NAME` variable in `.env`. |
|
||||||
|
| 📋 | Provides detailed debug logs showing all changes. |
|
||||||
|
| 🔐 | Outputs the base64-encoded content of the final `.env` file. |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📖 Debugging & Logs
|
||||||
|
|
||||||
|
Detailed debug logs are provided at every step, making troubleshooting easy:
|
||||||
|
|
||||||
|
```
|
||||||
|
DEBUG: .env file exists. Updating STACK_NAME.
|
||||||
|
DEBUG: Updated existing STACK_NAME to 'my-awesome-stack'.
|
||||||
|
DEBUG: Final .env content:
|
||||||
|
STACK_NAME=my-awesome-stack
|
||||||
|
DEBUG: Successfully encoded .env file to base64.
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚠️ Requirements
|
||||||
|
|
||||||
|
- Your workflow must have write permissions to the repository directory.
|
||||||
|
- Bash shell environment.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📜 License
|
||||||
|
|
||||||
|
This action is open-source software licensed under the MIT license.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Happy coding! 🎉
|
||||||
|
|
||||||
|
— **Grand**
|
||||||
|
|
||||||
### Should probably use better alternatives like:
|
### Should probably use better alternatives like:
|
||||||
- https://github.com/marketplace/actions/configuration-variable-substitution
|
- https://github.com/marketplace/actions/configuration-variable-substitution
|
||||||
|
|||||||
Reference in New Issue
Block a user