-
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?
Conversation
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: - dotnet#36447 - dotnet#29032 So automate the update using GitHub Actions.
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
this is cheap enough that it seems reasonable to me
git config user.name 'TODO' | ||
git config user.email '[email protected]' |
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.
Are there any standard/recommended name/email combinations I can use?
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
We have a precedence:
eng/common/core-templates/steps/source-build.yml: git config user.email [email protected]
eng/common/core-templates/steps/source-build.yml- git config user.name dn-bot
--
eng/pipelines/templates/steps/vmr-pull-updates.yml- git config --global user.name "dotnet-maestro[bot]"
eng/pipelines/templates/steps/vmr-pull-updates.yml: git config --global user.email "dotnet-maestro[bot]@users.noreply.github.com"
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 comment
The 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 comment
The 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.
@@ -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 comment
The 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 git add
.
run: | | ||
set -euo pipefail | ||
|
||
rm ./documentation/manpages/sdk/* |
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.
Deleting everything allows stale pages to be removed.
Sample run: https://github.com/omajid/dotnet-sdk/actions/runs/14765764022 PR that it opened: omajid#3 |
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.
Left a couple comments. Making a workflow out of this makes perfect sense to me, I just have a few questions I'm asking internally about permissions/security.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
this is cheap enough that it seems reasonable to me
@@ -0,0 +1,39 @@ | |||
name: Update man-pages workflow | |||
on: |
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
git config user.name 'TODO' | ||
git config user.email '[email protected]' |
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.
see my comment about the workflow trigger above. I don't think we have any names/aliases readily available for recurring cleanup-style work
./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 comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's very common to use the combination of:
git config user.name "github-actions"
git config user.email "[email protected]"
e.g:
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:
So automate the update using GitHub Actions.