mirror of
https://github.com/nubenetes/awesome-kubernetes.git
synced 2026-07-13 02:10:15 +00:00
89 lines
2.9 KiB
YAML
89 lines
2.9 KiB
YAML
name: 05.1. README Automated Sync
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'data/inventory.yaml'
|
|
- 'docs/**'
|
|
- 'v2-docs/**'
|
|
workflow_dispatch: # Permite ejecución manual desde la pestaña Actions
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: develop-git-write-lock
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
sync-readme:
|
|
runs-on: ubuntu-latest
|
|
if: |
|
|
github.event_name == 'workflow_dispatch' || (
|
|
github.event.head_commit != null &&
|
|
!contains(github.event.head_commit.message, '[skip ci]') &&
|
|
!contains(github.event.head_commit.message, 'bot/v2-elite-sync') &&
|
|
!contains(github.event.head_commit.message, 'bot/knowledge-update')
|
|
)
|
|
steps:
|
|
- name: Repository Synchronization
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0 # Full history for commit stats
|
|
|
|
- name: Python 3.11 Environment Provisioning
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pyyaml pytz python-dotenv
|
|
|
|
- name: Execute README Metric Updater
|
|
run: |
|
|
export PYTHONPATH=$PYTHONPATH:.
|
|
python src/readme_updater.py
|
|
|
|
- name: Validate README Integrity (Guardrail)
|
|
run: |
|
|
export PYTHONPATH=$PYTHONPATH:.
|
|
python src/safety_readme.py
|
|
|
|
- name: Commit and Push README Updates
|
|
run: |
|
|
git config --global user.name "Nubenetes Bot"
|
|
git config --global user.email "bot@nubenetes.com"
|
|
git add README.md
|
|
if git diff --staged --quiet; then
|
|
echo "No changes in README.md to commit."
|
|
else
|
|
git commit -m "docs: automated README metric synchronization [skip ci]"
|
|
# Pull, rebase, and push with automatic resolution of README.md conflicts
|
|
for i in {1..5}; do
|
|
if git pull origin develop --rebase; then
|
|
if git push origin develop; then
|
|
exit 0
|
|
fi
|
|
else
|
|
echo "Rebase conflict detected, attempting self-healing..."
|
|
# Discard local conflicting changes to README.md and accept remote
|
|
git checkout --ours README.md || git checkout --theirs README.md
|
|
git add README.md
|
|
# Continue rebase
|
|
GIT_EDITOR=true git rebase --continue || { git rebase --abort; git pull origin develop; }
|
|
# Re-run README sync to update metrics with remote state incorporated
|
|
python -m src.readme_updater
|
|
python -m src.safety_readme
|
|
git add README.md
|
|
git commit --amend --no-edit
|
|
fi
|
|
sleep 5
|
|
done
|
|
git push origin develop
|
|
fi
|