REPO="flexi-servers/fusionauth-rust-client" ASSIGNEE="devmaxde"
url=https://raw.githubusercontent.com/FusionAuth/fusionauth-openapi/master/openapi.yaml
echo "Fetching swagger from $url"
curl "$url" --max-time 5 > api.yaml
API_VERSION=$(grep 'version:' "api.yaml" | awk '{print $2}')
CARGO_VERSION=$(grep 'version:' "api_version.yaml" | awk '{print $2}')
if [ "$API_VERSION" != "$CARGO_VERSION" ]; then
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-d "{\"title\": \"New Version $API_VERSION Available\", \"body\": \"A new version of the software is available: $API_VERSION.\", \"assignees\": [\"$ASSIGNEE\"]}" \
"https://api.github.com/repos/$REPO/issues"
fi