@@ -139,6 +139,29 @@ All inputs are automatically converted to environment variables with the `SETTLE
139139- ` workspace` → `SETTLEMINT_WORKSPACE`
140140- ` blockchain-network` → `SETTLEMINT_BLOCKCHAIN_NETWORK`
141141
142+ # ## Environment Files
143+ The action supports loading environment variables from `.env` files. You can provide the content of your env files through the following inputs :
144+
145+ - `dotEnvFile` : Content of your main `.env` file
146+ - `dotEnvLocalFile` : Content of your `.env.local` file
147+
148+ ⚠️ **Important** : Always store env file contents in GitHub Secrets:
149+ ` ` ` yaml
150+ steps:
151+ - uses: settlemint/settlemint-action@main
152+ with:
153+ dotEnvFile: ${{ secrets.MY_ENV_FILE }}
154+ dotEnvLocalFile: ${{ secrets.MY_ENV_LOCAL }}
155+ access-token: ${{ secrets.SETTLEMINT_ACCESS_TOKEN }}
156+ ` ` `
157+
158+ The action will process these files and add all variables to the GitHub Actions environment. It handles :
159+ - Comments (lines starting with # )
160+ - Empty lines
161+ - Quoted values
162+ - Values containing = signs
163+ - Trailing comments
164+
142165# # Error Handling
143166
144167The action will fail if :
@@ -153,6 +176,32 @@ The action will fail if:
153176- Use GitHub Secrets for sensitive information
154177- Consider using OIDC for token management in production
155178
179+ # # Security Best Practices
180+
181+ # ## Handling Secrets 🔒
182+ - **NEVER** commit access tokens, private keys or any secrets directly in your workflow files or repository
183+ - **ALWAYS** use GitHub Secrets for sensitive information:
184+ ` ` ` yaml
185+ # ✅ CORRECT - Using GitHub Secrets
186+ access-token: ${{ secrets.SETTLEMINT_ACCESS_TOKEN }}
187+
188+ # ❌ WRONG - NEVER do this
189+ access-token: "your-token-here" # This is a security risk!
190+ ` ` `
191+ - Use GitHub's OIDC (OpenID Connect) for token management in production environments
192+ - Regularly rotate your access tokens and secrets
193+ - Limit secret access to only the necessary workflows and repositories
194+
195+ # ## Environment Variables
196+ When using .env files :
197+ ` ` ` yaml
198+ steps:
199+ - uses: settlemint/settlemint-action@main
200+ with:
201+ dotEnvFile: ${{ secrets.ENV_FILE_CONTENT }} # Store as a secret!
202+ access-token: ${{ secrets.SETTLEMINT_ACCESS_TOKEN }}
203+ ` ` `
204+
156205# # Contributing
157206
158207Contributions are welcome! Please read our [Contributing Guide](./.github/CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
0 commit comments