Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/changed_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
id: format
env:
GH_TOKEN: ${{ github.token }}
NETLIFY_SITE_NAME: ${{ vars.NETLIFY_SITE_NAME || 'cockroachlabs-docs' }}
run: |
declare -a output
pr_num=${{ github.event.pull_request.number }}
Expand All @@ -27,9 +28,11 @@ jobs:
files=($files)
IFS=$SAVEIFS

NETLIFY_SITE_NAME="${NETLIFY_SITE_NAME:-cockroachdb-docs}"

function generateMainFiles() {
html_file=`echo "${1%.md}.html" | sed -E 's/src\/[^\/]*\///g'`
file="<li><a href=\"https://deploy-preview-$pr_num--cockroachdb-docs.netlify.app/docs/$html_file\" target=\"_blank\" rel=\"noopener\">$1</a></li>"
file="<li><a href=\"https://deploy-preview-$pr_num--${NETLIFY_SITE_NAME}.netlify.app/docs/$html_file\" target=\"_blank\" rel=\"noopener\">$1</a></li>"
output+="$file"
}

Expand Down Expand Up @@ -86,7 +89,7 @@ jobs:
read -ra path <<< "$file"
IFS=$OLDIFS
major_version=${path[-2]}
file="<li>${file}:<ul><li><a href=\"https://deploy-preview-$pr_num--cockroachdb-docs.netlify.app/docs/releases/${major_version}.html\" target=\"_blank\" rel=\"noopener\">releases/${major_version}.md</a></li></ul></li>"
file="<li>${file}:<ul><li><a href=\"https://deploy-preview-$pr_num--${NETLIFY_SITE_NAME}.netlify.app/docs/releases/${major_version}.html\" target=\"_blank\" rel=\"noopener\">releases/${major_version}.md</a></li></ul></li>"
output+="$file"
elif [[ $file == src/*/_includes/v* || $file == src/*/_includes/cockroachcloud* || $file == src/*/images/* ]] && [[ $file != src/**/*.json ]] && [[ $file != *.gitignore* ]]
then
Expand Down
Loading