Skip to content

Commit

Permalink
Use subshell to set IFS again
Browse files Browse the repository at this point in the history
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
  • Loading branch information
bact authored Sep 2, 2024
1 parent 154d92e commit 73d4b3d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/publish_v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ jobs:
# Fallback for backward compatibility with old URLs before v3.0.1
working-directory: spdx-spec
run: |
ALL_VERSIONS=$(echo "$VERSION" "$VERSION_ALIASES")
MAP_PATH="etc/model-redirect-map.csv"
TEMPLATE_PATH="etc/model-redirect-template.html"
INDEX_HTML="index.html"
Expand All @@ -174,13 +173,15 @@ jobs:
git checkout $GH_PAGES_BRANCH
IFS=$'\n'
for line in $maps; do
echo "$line" | IFS=',' read -r from to
for alias in $ALL_VERSIONS; do
echo "Redirect: $alias/docs/model/$from -> $VERSION/docs/model/$to"
html=$(echo "$template" | sed -e "s/__VERSION__/$VERSION/g" -e "s/__THING__/$to/g")
mkdir -p "$alias/docs/model/$from"
echo "$html" > "$alias/docs/model/$from/$INDEX_HTML"
git add "$alias/docs/model/$from/$INDEX_HTML"
for alias in $VERSION $VERSION_ALIASES; do
(
echo "$line" | IFS=',' read -r from to
echo "Redirect: $alias/docs/model/$from -> $VERSION/docs/model/$to"
html=$(echo "$template" | sed -e "s/__VERSION__/$VERSION/g" -e "s/__THING__/$to/g")
mkdir -p "$alias/docs/model/$from"
echo "$html" > "$alias/docs/model/$from/$INDEX_HTML"
git add "$alias/docs/model/$from/$INDEX_HTML"
)
done
done
git commit -m "Add model redirections for: $VERSION $VERSION_ALIASES"
Expand Down

0 comments on commit 73d4b3d

Please sign in to comment.