Skip to content

Commit d9724df

Browse files
authored
Integrate publish-documentation into release workflow; remove push auto-trigger (#169)
`publish-documentation.yml` was firing automatically on every push to `release/**`, running independently from `release.yml` and outside the controlled release pipeline. ## Changes **`publish-documentation.yml`** - Replaced `push` trigger with `workflow_call` — workflow is now exclusively driven by `release.yml` or manual dispatch - `workflow_dispatch` retained for on-demand runs **`release.yml`** - Added `publish-documentation` job between `pack` and `publish-package`: - Depends on `pack` + `validate-release` - Gated with `if: is-release == 'true'` — skipped on `preview/**` branches - Calls `./.github/workflows/publish-documentation.yml` with explicit `pages: write` + `id-token: write` permissions - Updated `publish-package` to depend on `publish-documentation` with an `always()`-based condition to handle the `skipped` result on preview branches, preventing the gate from blocking NuGet publishing: ```yaml publish-package: needs: [pack, validate-release, publish-documentation] if: >- always() && needs.pack.result == 'success' && needs.validate-release.result == 'success' && (needs.publish-documentation.result == 'success' || needs.publish-documentation.result == 'skipped') ```
1 parent a48f79c commit d9724df

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/publish-documentation.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- 'release/**'
8-
paths:
9-
- 'src/**'
10-
- 'api-reference/**'
5+
workflow_call:
116

127
permissions:
138
actions: read

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,20 @@ jobs:
206206
${{ runner.temp }}/${{ env.nuget-packages-directory }}/**/*.nupkg
207207
${{ runner.temp }}/${{ env.nuget-packages-directory }}/**/*.snupkg
208208
209+
publish-documentation:
210+
name: 'Publish documentation'
211+
needs: [pack, validate-release, workflow-variables]
212+
if: ${{ needs.workflow-variables.outputs.is-release == 'true' }}
213+
uses: ./.github/workflows/publish-documentation.yml
214+
permissions:
215+
actions: read
216+
pages: write
217+
id-token: write
218+
209219
publish-package:
210220
name: 'Publish package'
211-
needs: [pack, validate-release]
221+
needs: [pack, validate-release, publish-documentation]
222+
if: ${{ always() && needs.pack.result == 'success' && needs.validate-release.result == 'success' && (needs.publish-documentation.result == 'success' || needs.publish-documentation.result == 'skipped') }}
212223
env:
213224
package-artifact-name: ${{ needs.pack.outputs.package-artifact-name }}
214225
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)