-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add GitHub Action workflow to update man pages #48784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,39 @@ | ||||||
name: Update man-pages workflow | ||||||
on: | ||||||
schedule: | ||||||
- cron: "42 3 1/15 * *" # Trigger every 15 days at 03:42 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is running an update twice a month too frequent? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is cheap enough that it seems reasonable to me |
||||||
#- cron: "0,5,10,15,20,25,30,35,40,45,50,55 * * * *" # For testing | ||||||
|
||||||
permissions: | ||||||
contents: write | ||||||
pull-requests: write | ||||||
|
||||||
jobs: | ||||||
update-man-pages: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- name: Checkout repository code | ||||||
uses: actions/checkout@v4 | ||||||
|
||||||
- name: Update man-pages | ||||||
run: | | ||||||
set -euo pipefail | ||||||
|
||||||
rm ./documentation/manpages/sdk/* | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deleting everything allows stale pages to be removed. |
||||||
|
||||||
./documentation/manpages/tool/run_docker.sh | ||||||
|
||||||
if [[ -n $(git status -s) ]]; then | ||||||
git config user.name 'TODO' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's very common to use the combination of:
e.g: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes sense to me! |
||||||
git config user.email 'TODO@example.com' | ||||||
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there any standard/recommended name/email combinations I can use? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see my comment about the workflow trigger above. I don't think we have any names/aliases readily available for recurring cleanup-style work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a precedence:
I think the idea is to run it automatically so we don't forget to update (we frequently forget to update the manpages). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't want to re-use those names without checking with the arcade and/or MS source-build teams first - we (SDK) don't control those identities and I wouldn't want to muddy contributions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @dotnet/product-construction. Could we tie the triggering to the release cadence? i.e. add to the list of prerequisites of release (both previews and GA). Job only took 42s to complete https://github.com/omajid/dotnet-sdk/actions/runs/14769460163. |
||||||
date=$(date +%F) | ||||||
git add . | ||||||
title="Update man pages" | ||||||
branch=update-man-page-$date | ||||||
git checkout -b $branch | ||||||
git commit -a -m "$title" | ||||||
git push -u origin $branch --force | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason we are using |
||||||
gh pr create --base main --head $branch --title "$title" --body "Auto-generated" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we could add an Maybe we could add some additional details to the PR body?
Suggested change
|
||||||
fi | ||||||
env: | ||||||
GH_TOKEN: ${{ github.token }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,4 +55,4 @@ ls docs-main/docs/core/tools/dotnet*.md | while read -r file; | |
"$file" -o "${command_name}"."${man_page_section}" | ||
done | ||
|
||
# rm -rf docs-main | ||
rm -rf docs-main | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a sub-repo (or a subdirectory) that we never want to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we change this to be a manually-triggered workflow, then the username question for the commit that's created has an easy answer - the name/email of the user that triggered the action