|
| 1 | +name: Update Cmdlet Help |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + # Run monthly on the 1st day at 00:00 UTC |
| 5 | + - cron: '0 0 1 * *' |
| 6 | + workflow_dispatch: # Allow manual triggering |
| 7 | + |
| 8 | +jobs: |
| 9 | + update-help: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + permissions: |
| 12 | + contents: write |
| 13 | + pull-requests: write |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout repository |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Clone help repositories |
| 20 | + run: | |
| 21 | + mkdir -p docfx/help-repos |
| 22 | + cd docfx/help-repos |
| 23 | + |
| 24 | + # Clone PnP PowerShell documentation |
| 25 | + git clone --depth 1 https://github.com/pnp/powershell.git pnp-powershell |
| 26 | + |
| 27 | + # Clone CLI for Microsoft 365 documentation |
| 28 | + git clone --depth 1 https://github.com/pnp/cli-microsoft365.git cli-microsoft365 |
| 29 | + |
| 30 | + # Clone SharePoint PowerShell documentation |
| 31 | + git clone --depth 1 https://github.com/MicrosoftDocs/OfficeDocs-SharePoint-PowerShell.git OfficeDocs-SharePoint-PowerShell |
| 32 | +
|
| 33 | + - name: Run Get-HelpJson.ps1 |
| 34 | + shell: pwsh |
| 35 | + run: | |
| 36 | + cd docfx |
| 37 | + ./Get-HelpJson.ps1 |
| 38 | +
|
| 39 | + - name: Check for changes |
| 40 | + id: check_changes |
| 41 | + run: | |
| 42 | + if git diff --quiet docfx/assets/help/*.help.json; then |
| 43 | + echo "has_changes=false" >> $GITHUB_OUTPUT |
| 44 | + else |
| 45 | + echo "has_changes=true" >> $GITHUB_OUTPUT |
| 46 | + fi |
| 47 | +
|
| 48 | + - name: Create Pull Request |
| 49 | + if: steps.check_changes.outputs.has_changes == 'true' |
| 50 | + uses: peter-evans/create-pull-request@v6 |
| 51 | + with: |
| 52 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + commit-message: 'Update cmdlet help documentation' |
| 54 | + title: 'Update Cmdlet Help Documentation' |
| 55 | + body: | |
| 56 | + ## Automated Cmdlet Help Update |
| 57 | + |
| 58 | + This PR updates the cmdlet help documentation by pulling the latest changes from the upstream repositories: |
| 59 | + - [pnp/powershell](https://github.com/pnp/powershell) |
| 60 | + - [pnp/cli-microsoft365](https://github.com/pnp/cli-microsoft365) |
| 61 | + - [MicrosoftDocs/OfficeDocs-SharePoint-PowerShell](https://github.com/MicrosoftDocs/OfficeDocs-SharePoint-PowerShell) |
| 62 | + |
| 63 | + The following help files have been updated: |
| 64 | + - `docfx/assets/help/powershell.help.json` - PnP PowerShell cmdlets |
| 65 | + - `docfx/assets/help/cli.help.json` - CLI for Microsoft 365 commands |
| 66 | + - `docfx/assets/help/spoms.help.json` - SharePoint Online Management Shell cmdlets |
| 67 | + |
| 68 | + Please review the changes and merge if everything looks correct. |
| 69 | + branch: automated/update-cmdlet-help |
| 70 | + delete-branch: true |
| 71 | + labels: | |
| 72 | + automated |
| 73 | + documentation |
0 commit comments