Skip to content

Commit 178c120

Browse files
Draft workflow updater
1 parent f3d877a commit 178c120

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Generate Lib/idlelib/help.html
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "Doc/library/idle.rst"
7+
8+
jobs:
9+
generate-help-html:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.x'
22+
- name: Set up Git user
23+
run: |
24+
git config user.name "github-actions[bot]"
25+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
27+
- env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
gh auth login --with-token <<< "${GITHUB_TOKEN}"
31+
gh pr checkout ${{ github.event.pull_request.number }}
32+
33+
- run: |
34+
cd Doc
35+
make venv
36+
make html
37+
python -c "from idlelib.help import copy_strip; copy_strip()"
38+
39+
- run: |
40+
git add Lib/idlelib/help.html
41+
git diff --staged --quiet || git commit -m "Auto-update help.html from idle.rst"
42+
43+
- env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
git push

0 commit comments

Comments
 (0)