Files
awesome-kubernetes/.github/workflows/05.1.readme_sync.yml
dependabot[bot] 8441623163 build(deps): bump the action-updates group with 3 updates
Bumps the action-updates group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [actions/cache](https://github.com/actions/cache) and [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch).


Updates `actions/checkout` from 6 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

Updates `actions/cache` from 5 to 6
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5...v6)

Updates `peter-evans/repository-dispatch` from 3 to 4
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases)
- [Commits](https://github.com/peter-evans/repository-dispatch/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: action-updates
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: action-updates
- dependency-name: peter-evans/repository-dispatch
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: action-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-01 13:18:37 +00:00

92 lines
3.2 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@v7
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"
export PYTHONPATH=$PYTHONPATH:.
# README.md is a *pure function* of the inventory, so we never need to
# preserve a local README state: each attempt hard-resets to the freshest
# remote tip, regenerates, commits and pushes. This eliminates the two
# failure classes that previously broke this job:
# 1. Dirty-tree abort — the earlier steps modify README.md, then
# `git pull` aborted with "local changes would be overwritten by merge".
# 2. Merge/rebase --ours/--theirs confusion under concurrent bot pushes.
# A push can now only be rejected if the remote advanced between reset and
# push; we simply retry from the new tip. No conflict resolution required.
for i in {1..5}; do
echo "README sync attempt $i/5..."
git fetch origin develop
git reset --hard origin/develop
python src/readme_updater.py
python src/safety_readme.py
git add README.md
if git diff --staged --quiet; then
echo "README already in sync with inventory. Nothing to commit."
exit 0
fi
git commit -m "docs: automated README metric synchronization [skip ci]"
if git push origin develop; then
echo "Push succeeded on attempt $i."
exit 0
fi
echo "Attempt $i rejected — remote advanced, retrying from fresh tip..."
sleep $((i * 3))
done
echo "::error::README sync failed after 5 attempts (persistent write contention on develop)."
exit 1