diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 8470bfeb..e0d4082c 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -12,7 +12,7 @@ on: workflow_dispatch: permissions: - contents: write + contents: read pages: write id-token: write pull-requests: write @@ -47,22 +47,27 @@ jobs: - name: Setup Pages id: pages uses: actions/configure-pages@v5 + - name: Generate Dev Docs from JSON shell: pwsh run: | Set-Location tools ./devdocs-generator.ps1 - - name: Create Pull Request 🚀 + - name: Create Pull Request id: cpr uses: peter-evans/create-pull-request@v6 with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: 'Update generated documentation' + token: ${{ secrets.AUTO_MERGE }} + commit-message: 'chore: Update generated dev docs' title: 'chore: Update Generated Dev Docs' body: 'Automated update of generated documentation from JSON sources' branch: docs-update delete-branch: true + add-paths: | + docs/content/dev/ + config/tweaks.json + config/feature.json labels: | automated documentation diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index c6fc7cd9..fae043fe 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -3,6 +3,7 @@ name: Pre-Release WinUtil permissions: contents: write actions: read + pull-requests: write on: workflow_dispatch: # Manual trigger added @@ -22,25 +23,35 @@ jobs: Set-Location tools ./devdocs-generator.ps1 - - name: Commit Updated JSON Links - shell: pwsh - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add config/tweaks.json config/feature.json - $changes = git diff --cached --quiet; if ($LASTEXITCODE -ne 0) { - git commit -m "Update documentation links in JSON configs" - git push - } else { - Write-Host "No JSON link changes to commit" - } - - name: Compile project shell: pwsh run: | Set-ExecutionPolicy Bypass -Scope Process -Force; ./Compile.ps1 continue-on-error: false # Directly fail the job on error, removing the need for a separate check + - name: Create Pull Request for Updated JSON Links + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.AUTO_MERGE }} + commit-message: 'chore: Update documentation links in JSON configs' + title: 'chore: Update Generated Dev Docs' + body: 'Automated update of documentation links in JSON configs from pre-release build' + branch: docs-update + delete-branch: true + add-paths: | + config/tweaks.json + config/feature.json + labels: | + automated + documentation + + - name: Check outputs + shell: bash + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + - name: Set Version to Todays Date id: extract_version run: |