Skip to content

Commit

Permalink
Fix doc syncing for .x removal
Browse files Browse the repository at this point in the history
  • Loading branch information
huonw committed Jan 3, 2024
1 parent 39a7d3f commit 95a17c9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/sync_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,15 @@ jobs:
path: pantsbuild.org

# Calculate destination
- name: Calculate branch name
id: get-branch-name
run: echo "BRANCH_NAME=$(echo "${{ inputs.version }}" | sed -E 's/^([0-9]+)\.([0-9]+)\.\w+.*/\1.\2.x/')" >> "${GITHUB_OUTPUT}"
- name: Calculate destination
id: get-destination-dir
run: |
DESTINATION_DIR="versioned_docs/version-${{ steps.get-branch-name.outputs.BRANCH_NAME }}"
BASE_VERSION=$(echo "${{ inputs.version }}" | sed -E 's/^([0-9]+)\.([0-9]+)\.\w+.*/\1.\2/')
DESTINATION_DIR="versioned_docs/version-$BASE_VERSION"
if [ ! -d "pantsbuild.org/$DESTINATION_DIR" ]; then
DESTINATION_DIR="docs"
fi
echo "DESTINATION_DIR=$(echo "$DESTINATION_DIR")" >> "${GITHUB_OUTPUT}"
echo "DESTINATION_DIR=$(echo "$DESTINATION_DIR")" | tee -a "${GITHUB_OUTPUT}"
- run: |
rm -rf "pantsbuild.org/${{ steps.get-destination-dir.outputs.DESTINATION_DIR }}"
mkdir "pantsbuild.org/${{ steps.get-destination-dir.outputs.DESTINATION_DIR }}"
Expand Down

0 comments on commit 95a17c9

Please sign in to comment.