Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fflaten committed Jun 16, 2024
1 parent 6e9bba6 commit 20088b2
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/generate-pester-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,36 @@ jobs:

# This step will also install and import modules incl. selected Pester-version
- name: Update Command Reference
id: commands
shell: pwsh
run: |
./generate-command-reference.ps1 -PesterVersion '${{ env.PESTER }}' -DocsVersion '${{ env.DOCS }}'
# Output if any files were modified
$updated = $null -ne (git status -s | Select-String '/commands/')
"updated=$updated" >> $env:GITHUB_OUTPUT
- name: Update PesterConfiguration docs
if: ${{ env.DOCS != 'v4' }}
id: config
shell: pwsh
run: |
./generate-pesterconfiguration-docs.ps1 -PesterVersion '${{ env.PESTER }}' -Style Table -DocsVersion '${{ env.DOCS }}'
# Output if any files were modified
$updated = $null -ne (git status -s | Select-String '/usage/Configuration.mdx')
"updated=$updated" >> $env:GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
id: create-pr
env:
PR_BRANCH: "docs-update/${{ env.DOCS }}-v${{ env.PESTER }}"
TITLE_PREFIX: "${{ env.DOCS != 'Current' && format('({0}) ', env.DOCS) || '' }}"
with:
branch: ${{ env.PR_BRANCH }}
branch-suffix: short-commit-hash
draft: false
# Should always be reviewed by author to fix typos or other errors
reviewers: ${{ github.actor_id }}
# Set user triggering the workflow as author (default in action)
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
# Github Action as commit (explicit default)
Expand All @@ -65,12 +77,22 @@ jobs:
add-paths: |
docs
versioned_docs
title: ${{ env.TITLE_PREFIX }}Update generated docs to Pester v${{ env.PESTER }}
title: ${{ env.TITLE_PREFIX }}Update docs to Pester v${{ env.PESTER }}
body: |
Updates Command Reference and/or PesterConfiguration documentation.
Updates generated documentation using the specified Pester-version.
Docs version being updated: ${{ env.DOCS }}
Pester version used: v${{ env.PESTER }}
**Docs version:** Current
**Pester version:** v6.0.0-alpha1
*PR created using '${{ github.workflow }}' workflow*
draft: false
| Documentation updated | Result |
|-----------------------|--------|
| Command Reference | ${{ steps.commands.outputs.updated }} |
| PesterConfiguration section | ${{ steps.config.outputs.updated }} |
*PR created using 'Update Pester Docs' workflow*
- name: Output PR details
if: ${{ steps.create-pr.outputs.pull-request-number }}
run: |
echo "Pull Request created (#${{ steps.create-pr.outputs.pull-request-number }})"
echo "Pull Request URL - ${{ steps.create-pr.outputs.pull-request-url }}"

0 comments on commit 20088b2

Please sign in to comment.