Skip to content
Merged
Show file tree
Hide file tree
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
37 changes: 37 additions & 0 deletions .github/workflows/check-api-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check API version lock

on:
# run after PR merge
push:
branches: ["main"]
# run every night at 01:00
schedule:
- cron: "0 1 * * *"

env:
THRESHOLD: "10 days ago"

jobs:
main-go:
name: "[Go] Update SDK Repo"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check commit date
run: |
set -eo pipefail

THRESHOLD="10 minutes ago"

if jq -e 'map_values(select(. != "main")) != {}' api-versions-lock.json; then
thresholdDate=$(date -Iminutes -d "${THRESHOLD}")
commitDate=$(git -P log -n 1 --format="%aI" api-versions-lock.json)
if [[ "$commitDate" < "$thresholdDate" ]]; then
echo "latest commit of api-versions-lock.json is older than ${THRESHOLD}"
exit 1
fi
echo "api-versions-lock.json contains locked versions but is recent enough"
else
echo "no locked versions in api-versions-lock.json"
fi
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Check API version lock](https://github.com/stackitcloud/stackit-sdk-generator/actions/workflows/check-api-versions.yaml/badge.svg)](https://github.com/stackitcloud/stackit-sdk-generator/actions/workflows/check-api-versions.yaml)

# Overview

This repository implements the automatic generation of client libraries to access STACKIT APIs. It is based on the [OpenAPI Generator](https://openapi-generator.tech/). The process' input are the REST API specs in the [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification) format (OAS), which are stored in [STACKIT API specifications](https://github.com/stackitcloud/stackit-api-specifications).
Expand Down
Loading