File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,8 +105,17 @@ jobs:
105105 git config user.name "docs-bot"
106106 git config user.email "77750099+docs-bot@users.noreply.github.com"
107107 git add data/llms-txt/docs.md
108- git commit -m "Update data/llms-txt/docs.md from popularity data"
109- git push "https://x-access-token:${GH_TOKEN}@github.com/github/docs-internal.git" "$BRANCH"
108+ # diff_docs compares against main, but the sync branch may already
109+ # exist with this exact content (open PR from a prior run). In that
110+ # case there is nothing new to stage, and `git commit` would exit 1
111+ # and fail the whole workflow. Skip the commit and push when the
112+ # branch is already up to date.
113+ if git diff --cached --quiet; then
114+ echo "Sync branch already has the latest generated docs.md; nothing to commit."
115+ else
116+ git commit -m "Update data/llms-txt/docs.md from popularity data"
117+ git push "https://x-access-token:${GH_TOKEN}@github.com/github/docs-internal.git" "$BRANCH"
118+ fi
110119
111120 - name : Create or update docs-internal PR
112121 if : steps.diff_docs.outputs.changed == 'true'
You can’t perform that action at this time.
0 commit comments