chore(ci): add auto-complete TODO workflow
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 26s
CI / Build (push) Successful in 20s

Introduce Gitea Actions workflow to automatically move TODO files from queued to completed on PR events for feature branches.
Update README with setup instructions and benefits.
This commit is contained in:
Greg Gauthier 2026-03-02 19:20:11 +00:00
parent 742edd7742
commit d0a4b8922d
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,37 @@
name: 'Auto-complete TODO'
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
move-todo:
runs-on: ubuntu-latest
steps:
- name: 'Clone PR branch, move TODO, push update'
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
SERVER_URL: ${{ github.server_url }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.pull_request.head.repo.name }}
PR_BRANCH: ${{ github.head_ref }}
run: |
git clone https://${PAT_TOKEN}@${SERVER_URL}/${REPO_OWNER}/${REPO_NAME}.git pr-temp || exit 1
cd pr-temp
git checkout ${PR_BRANCH}
BRANCH=$(git rev-parse --abbrev-ref HEAD)
TODO_NAME="${BRANCH#feature/}.md"
if [[ "${BRANCH}" == feature/* && -f todo/queued/${TODO_NAME} ]]; then
mkdir -p todo/completed
mv todo/queued/${TODO_NAME} todo/completed/
git config user.name 'Gitea Actions Bot'
git config user.email 'actions@noreply.local'
git add todo/
git commit -m "chore: auto-complete ${TODO_NAME} via Gitea Actions"
git push https://${PAT_TOKEN}@${SERVER_URL}/${REPO_OWNER}/${REPO_NAME}.git ${PR_BRANCH}
echo "✅ Moved todo/queued/${TODO_NAME} → completed/"
else
echo " No action: branch='${BRANCH}', expected 'feature/*' with todo/queued/${TODO_NAME}"
fi
cd ..
rm -rf pr-temp

View File

@ -481,6 +481,18 @@ git commit -m "chore: complete some-todo"
git push origin master git push origin master
``` ```
### Gitea Actions Automation *(automates post-merge above)*
[`.gitea/workflows/auto-complete-todo.yml`](.gitea/workflows/auto-complete-todo.yml) triggers on PR `opened`/`synchronize`:
- Branches `feature/some-todo`: moves `todo/queued/some-todo.md``completed/`.
**One-time setup** (Gitea → Repo → Settings → Secrets & Variables → Actions):
- New Secret: `PAT_TOKEN` = [Personal Access Token](https://gitea.example.com/user/settings/tokens) (scope: `repo`).
- Optional: Branch protection → Require "Auto-complete TODO" status check.
**Result**: No manual post-merge steps needed!
## Documentation ## Documentation
- 📖 [Troubleshooting Guide](docs/TROUBLESHOOTING.md) - Common issues and solutions - 📖 [Troubleshooting Guide](docs/TROUBLESHOOTING.md) - Common issues and solutions