File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Check API version lock
2+
3+ on : [pull_request, workflow_dispatch]
4+
5+ env :
6+ THRESHOLD : " 10 days ago"
7+
8+ jobs :
9+ main-go :
10+ name : " [Go] Update SDK Repo"
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout
14+ uses : actions/checkout@v4
15+ - name : Check commit date
16+ run : |
17+ if $(jq -e 'map_values(select(. != "main")) == {}' api-versions-lock.json); then
18+ thresholdDate=$(date -Iminutes -d "${THRESHOLD}")
19+ commitDate=$(git -P log -n 1 --format="%aI" api-versions-lock.json)
20+ if [ ${commitDate} < ${thresholdDate} ]; then
21+ echo "latest commit of api-versions-lock.json is older than ${THRESHOLD}"
22+ exit 1
23+ fi
24+ echo "api-versions-lock.json contains locked versions but is recent is enough"
25+ else
26+ echo "no locked versions in api-versions-lock.json"
27+ fi
You can’t perform that action at this time.
0 commit comments