Chore/version check pipeline #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check API version lock | |
| on: [pull_request, workflow_dispatch] | |
| env: | |
| THRESHOLD: "10 days ago" | |
| jobs: | |
| main-go: | |
| name: "[Go] Update SDK Repo" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check commit date | |
| run: | | |
| 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 is enough" | |
| else | |
| echo "no locked versions in api-versions-lock.json" | |
| fi |