diff --git a/.gitea/workflows/readme.yml b/.gitea/workflows/readme.yml index 2112b2d..b5d7085 100644 --- a/.gitea/workflows/readme.yml +++ b/.gitea/workflows/readme.yml @@ -61,3 +61,30 @@ jobs: fi git commit -m "chore: refresh profile README" git push + + # Mirrors README.md to the GitHub profile repo (jonbranan/jonbranan). + # Generation has to happen here: the Komodo and Vikunja blocks read + # 10.5.0.3, which a GitHub-hosted runner cannot reach. No-op until the + # GH_PROFILE_TOKEN secret exists. + - name: Mirror to GitHub + if: github.event_name != 'pull_request' + env: + GH_PROFILE_TOKEN: ${{ secrets.GH_PROFILE_TOKEN }} + run: | + if [ -z "$GH_PROFILE_TOKEN" ]; then + echo "GH_PROFILE_TOKEN not set - skipping GitHub mirror" + exit 0 + fi + rm -rf /tmp/gh-profile + git clone --depth 1 https://github.com/jonbranan/jonbranan.git /tmp/gh-profile + cp README.md /tmp/gh-profile/README.md + cd /tmp/gh-profile + git config user.name trex + git config user.email nanobot@jonb.io + git add README.md + if git diff --cached --quiet; then + echo "GitHub README already current" + exit 0 + fi + git commit -m "chore: sync profile README from git.jonb.io" + git push "https://x-access-token:${GH_PROFILE_TOKEN}@github.com/jonbranan/jonbranan.git" HEAD:main