Add configurable worker credentials for git operations

- Replace hardcoded git user email and name with configurable variables
- Add WORKER_EMAIL and WORKER_USERNAME variables for git commits and authentication
- Update workflow to use vars.WORKER_EMAIL and vars.WORKER_USERNAME
- Use WORKER_USERNAME in push URL authentication instead of hardcoded 'ci-bot'
- Update GITEA-ACTIONS-SETUP.md with instructions for setting up repository variables
- Add variables to setup checklist for complete configuration
- Provide flexibility for different organizations and naming conventions
This commit is contained in:
2025-08-11 11:31:59 +07:00
parent 0e800242d7
commit 29b4ffe576
2 changed files with 20 additions and 5 deletions

View File

@@ -27,7 +27,19 @@ Ensure your Gitea instance has Actions enabled:
- Value: Paste the token from step 2
- Click "Add Secret"
### 4. Enable Repository Actions
### 4. Add Repository Variables
1. **Go to Repository Settings**:
- Navigate to your repository → Settings → Variables
2. **Add Worker Email Variable**:
- Name: `WORKER_EMAIL`
- Value: Email for git commits (e.g., `ci-bot@your-domain.com`)
- Click "Add Variable"
3. **Add Worker Username Variable**:
- Name: `WORKER_USERNAME`
- Value: Username for git commits (e.g., `CI Auto-Sort Bot`)
- Click "Add Variable"
### 5. Enable Repository Actions
1. **Repository Settings**: Go to Settings → Actions
2. **Enable Actions**: Check "Enable Actions"
3. **Allow all actions**: Select appropriate action permissions
@@ -209,6 +221,8 @@ When reporting issues, include:
- [ ] Gitea Actions enabled on instance
- [ ] CI bot token created with `repo` scope
- [ ] `CI_BOT_TOKEN` secret added to repository
- [ ] `WORKER_EMAIL` variable added to repository
- [ ] `WORKER_USERNAME` variable added to repository
- [ ] Repository Actions enabled
- [ ] Test files created and pushed
- [ ] Workflow executed successfully