Commit 6c502e7
Fix Docusaurus versioning error in publish_website workflow
Summary:
Fix Docusaurus versioning error when release workflow is re-run
## Problem
The 'Create new docusaurus version' step in publish_website.yml fails with:
```
Error: [docs]: this version already exists! Use a version tag that does not already exist.
```
This occurs when the release workflow is re-run for the same version (e.g., after a partial failure or manual re-trigger), because the version was already created and pushed to gh-pages in a previous run.
## Solution
Make the versioning step idempotent by checking if the version already exists in versions.json before attempting to create it:
1. Extract the version tag and remove the optional 'v' prefix
2. Check if versions.json exists and contains the version
3. Skip versioning if the version already exists, otherwise proceed normally
This allows the workflow to be safely re-run without failing.
Differential Revision: D953054761 parent ee72a65 commit 6c502e7
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | 89 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
| |||
0 commit comments