ci: replace docgen push with staleness check
Problem: the docgen workflow pushed directly to main, which is blocked by repository rulesets. No token-based push from GitHub Actions can bypass ruleset rules on personal repos. Solution: replace the push step with a git diff --exit-code check that fails if generated docs are out of date. Docs must now be committed by the developer via make doc. Also regenerates docs to reflect batch 4 changes (close_float, OilFileIcon, OilExecutableHidden, recipe link).
This commit is contained in:
parent
181e735c3b
commit
bb128e96af
3 changed files with 19 additions and 19 deletions
15
.github/workflows/tests.yml
vendored
15
.github/workflows/tests.yml
vendored
|
|
@ -84,20 +84,9 @@ jobs:
|
|||
run: |
|
||||
python -m pip install pyparsing==3.0.9
|
||||
make doc
|
||||
- name: Commit changes
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
COMMIT_MSG: |
|
||||
[docgen] Update docs
|
||||
skip-checks: true
|
||||
- name: Check docs are up to date
|
||||
run: |
|
||||
git config user.email "actions@github"
|
||||
git config user.name "Github Actions"
|
||||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
|
||||
git add README.md doc
|
||||
# Only commit and push if we have changes
|
||||
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})
|
||||
git diff --exit-code README.md doc
|
||||
|
||||
release:
|
||||
name: release
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue