Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow to publish schemas #4139

Closed
wants to merge 13 commits into from
Prev Previous commit
Next Next commit
Update schema-publish.sh
ralfhandl committed Oct 16, 2024
commit 98f055fd22106a5a9a0e7a23d6e71b0ec8ddaf23
9 changes: 4 additions & 5 deletions scripts/schema-publish.sh
Original file line number Diff line number Diff line change
@@ -5,21 +5,20 @@
# run this script from the root of the repo. It is designed to be run by a GitHub workflow.

for filename in schemas/v3*/schema.yaml ; do
version=$(basename $(dirname "$filename"))
vVersion=$(basename $(dirname "$filename"))
version=${vVersion:1}
lastCommitDate=$(git log -1 --format="%ad" --date=format:"%Y%m%d" "$filename")

echo "$filename $lastCommitDate"
mkdir -p deploy/oas/$version/schema
node scripts/schema-convert.js "$filename" $lastCommitDate > deploy/oas/$version/schema/$lastCommitDate
# mv deploy/oas/$version/schema/*.md deploy/oas/$version/schema/$lastCommitDate.md
ls deploy/oas/$version/schema/*
mv deploy/oas/$version/schema/*.md deploy/oas/$version/schema/$lastCommitDate.md

filenameBase=$(dirname "$filename")/schema-base.yaml
if [ -f "$filenameBase" ]; then
echo "$filenameBase $lastCommitDate"
mkdir -p deploy/oas/$version/schema-base
node scripts/schema-convert.js "$filenameBase" $lastCommitDate > deploy/oas/$version/schema-base/$lastCommitDate
# mv deploy/oas/$version/schema-base/*.md deploy/oas/$version/schema-base/$lastCommitDate.md
ls deploy/oas/$version/schema-base/*
mv deploy/oas/$version/schema-base/*.md deploy/oas/$version/schema-base/$lastCommitDate.md
fi
done