Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

omajid
Copy link
Member

@omajid omajid commented Apr 30, 2025

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.

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
Copy link
Member Author

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?

Copy link
Member

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

Comment on lines +27 to +28
git config user.name 'TODO'
git config user.email '[email protected]'
Copy link
Member Author

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?

Copy link
Member

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

Copy link
Member

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).

Copy link
Member

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.

Copy link
Member

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
Copy link
Member Author

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/*
Copy link
Member Author

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.

@omajid
Copy link
Member Author

omajid commented Apr 30, 2025

Sample run: https://github.com/omajid/dotnet-sdk/actions/runs/14765764022

PR that it opened: omajid#3

@omajid
Copy link
Member Author

omajid commented May 1, 2025

cc @am11 @baronfel @marcpopMSFT

Copy link
Member

@baronfel baronfel left a 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
Copy link
Member

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:
Copy link
Member

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

Comment on lines +27 to +28
git config user.name 'TODO'
git config user.email '[email protected]'
Copy link
Member

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'
Copy link
Member

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:

https://github.com/dotnet/msbuild/blob/1e7a0a86776c87955d195980fa1873447a3341af/.github/workflows/SyncAnalyzerTemplateMSBuildVersion.yml#L131-L134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants