Skip to content

Commit 2a8bc21

Browse files
committed
Add GitHub Action workflow to update man pages
This repo contains man pages. They are generated from another repo, and need to be updated manually. Generally, someone updates them once a year or so, and often it's too late for GA: - #36447 - #29032 So automate the update using GitHub Actions.
1 parent 1b8a94f commit 2a8bc21

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Update man-pages workflow
2+
on:
3+
schedule:
4+
- cron: "42 3 1/15 * *" # Trigger every 15 days at 03:42
5+
#- cron: "0,5,10,15,20,25,30,35,40,45,50,55 * * * *" # For testing
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
update-man-pages:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository code
16+
uses: actions/checkout@v4
17+
18+
- name: Update man-pages
19+
run: |
20+
set -euo pipefail
21+
22+
rm ./documentation/manpages/sdk/*
23+
24+
./documentation/manpages/tool/run_docker.sh
25+
26+
if [[ -n $(git status -s) ]]; then
27+
git config user.name 'TODO'
28+
git config user.email '[email protected]'
29+
date=$(date +%F)
30+
git add .
31+
title="Update man pages"
32+
branch=update-man-page-$date
33+
git checkout -b $branch
34+
git commit -a -m "$title"
35+
git push -u origin $branch --force
36+
gh pr create --base main --head $branch --title "$title" --body "Auto-generated"
37+
fi
38+
env:
39+
GH_TOKEN: ${{ github.token }}

documentation/manpages/tool/update-man-pages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ ls docs-main/docs/core/tools/dotnet*.md | while read -r file;
5555
"$file" -o "${command_name}"."${man_page_section}"
5656
done
5757

58-
# rm -rf docs-main
58+
rm -rf docs-main

0 commit comments

Comments
 (0)