forked from LengKundee/MQL5-Google-Onedrive
3.1 KiB
3.1 KiB
GitHub Actions Secrets Setup
This document provides guidance on setting up GitHub Secrets for the repository's CI/CD workflows.
Required Secrets
The following secrets should be configured in your GitHub repository settings:
Telegram Bot Configuration
-
TELEGRAM_BOT_TOKENorTELEGRAM_BOT_API- Value:
your_bot_token_here - Used by: Telegram bot deployment scripts
- Reference: https://core.telegram.org/bots/api
- Value:
-
TELEGRAM_ALLOWED_USER_IDS(Optional)- Value: Comma-separated list of Telegram user IDs authorized to use the bot
- Example:
123456789,987654321 - Used by: Telegram bot for access control
GitHub Automation
GITHUB_PAT(Optional)- Value:
your_github_personal_access_token_here - Used by: Scripts that need enhanced GitHub API access
- Scopes required:
repo,workflow,write:packages
- Value:
Existing Secrets (Already Configured)
RCLONE_CONFIG_B64- For OneDrive syncCLOUDFLARE_ZONE_ID- Cloudflare zone IDCLOUDFLARE_ACCOUNT_ID- Cloudflare account IDDOMAIN_NAME- Your domain nameSCRSOR- Firefox Relay API keyCOPILOT- Firefox Relay API keySLACK_WEBHOOK(Optional) - For Slack notifications
Setting Secrets via GitHub CLI
If you have the GitHub CLI installed, you can set secrets using:
# Set Telegram bot token
gh secret set TELEGRAM_BOT_TOKEN --body "your_bot_token_here"
# Set GitHub PAT
gh secret set GITHUB_PAT --body "your_github_personal_access_token_here"
# Set allowed users (replace with your actual Telegram user ID)
gh secret set TELEGRAM_ALLOWED_USER_IDS --body "your_telegram_user_id"
Setting Secrets via GitHub Web UI
- Go to your repository on GitHub
- Click Settings → Secrets and variables → Actions
- Click New repository secret
- Add each secret with its name and value
Using the Automated Script
You can also use the provided script to sync from your local vault:
# Make sure config/vault.json is properly configured
bash scripts/set_github_secrets.sh vault
This will read from config/vault.json and set the appropriate GitHub secrets.
Verification
After setting secrets, you can verify they're available in your workflows:
- Go to Actions tab in your repository
- Run a workflow that uses these secrets
- Check the workflow logs to ensure secrets are being loaded (values will be masked)
Security Notes
- Never log or print secret values in workflows
- GitHub automatically masks secret values in logs
- Rotate secrets regularly for security
- Use the minimum required scopes for tokens
- Store the actual values in a secure password manager
If a real token was ever committed to git, treat it as compromised: rotate/revoke it immediately (BotFather for Telegram, GitHub settings for PATs).
Troubleshooting
If secrets aren't working:
- Check secret names - They're case-sensitive
- Verify workflow permissions - Some secrets require specific permissions
- Check repository visibility - Public repos have different secret handling
- Review workflow syntax - Ensure you're accessing secrets correctly:
${{ secrets.SECRET_NAME }}