Skip to content

Commit fd301ec

Browse files
authored
Add GitHub Action workflow to update man pages (#48784)
2 parents dff7160 + f54b3b2 commit fd301ec

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 'github-actions'
28+
git config user.email '[email protected]'
29+
date=$(date +%F)
30+
git add .
31+
title="[automated] Update man pages"
32+
body="This action is executed twice a month to automatically update the manpages based on the latest changes to the dotnet/docs repo"
33+
branch=update-man-page-$date
34+
git checkout -b $branch
35+
git commit -a -m "$title"
36+
git push -u origin $branch --force
37+
gh pr create --base main --head $branch --title "$title" --body "$body"
38+
fi
39+
env:
40+
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)