Skip to content

Commit

Permalink
Added changelog rendering for components (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
zdmytriv authored Aug 9, 2023
1 parent 23d5683 commit 33e3875
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/website-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ jobs:
run: |
./scripts/render-docs-for-components.sh
- name: "Render Documentation for Terraform Components Change Log"
run: |
./scripts/render-docs-for-changelog.sh
- name: "Render Documentation for Terraform Modules"
env:
PUBLIC_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
Expand Down
Empty file added changelog/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions content/components/library/upgrade-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Upgrade Guide
sidebar_label: Upgrade Guide
description: Upgrade Guide
sidebar_position: 10
---
20 changes: 20 additions & 0 deletions scripts/render-docs-for-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e

GITHUB_REPO=${GITHUB_REPO:-"terraform-aws-components"}
TMP_CLONE_DIR="${TMP_CLONE_DIR:-tmp/components/${GITHUB_REPO}}"
INPUT_UPGRADE_GUIDE_FILE="${INPUT_UPGRADE_GUIDE_FILE:-${TMP_CLONE_DIR}/docs/upgrade-guide.md}"
OUTPUT_UPGRADE_GUIDE_FILE="content/components/library/upgrade-guide.md"
FRONT_MATTER=$(cat <<EOF
---
title: Upgrade Guide
sidebar_label: Upgrade Guide
description: Upgrade Guide
sidebar_position: 10
---
EOF
)

echo "${FRONT_MATTER}" > "${OUTPUT_UPGRADE_GUIDE_FILE}"
cat "${INPUT_UPGRADE_GUIDE_FILE}" >> "${OUTPUT_UPGRADE_GUIDE_FILE}"

0 comments on commit 33e3875

Please sign in to comment.