mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-18 00:06:27 +01:00
Add flock to openapi spec upload
Prevents a race condition if two PRs are merged in very quick succession.
This commit is contained in:
3
.github/workflows/ci-openapi.yml
vendored
3
.github/workflows/ci-openapi.yml
vendored
@@ -174,6 +174,8 @@ jobs:
|
||||
debug: false
|
||||
script_stop: false
|
||||
script: |
|
||||
(
|
||||
flock -x -w 300 200
|
||||
TGT_DIR="/srv/repository/main/openapi"
|
||||
LAST_SPEC="$( ls -lt ${TGT_DIR}/unstable/ | grep 'jellyfin-openapi' | head -1 | awk '{ print $NF }' )"
|
||||
# If new and previous spec don't differ (diff retcode 0), remove incoming and finish
|
||||
@@ -194,3 +196,4 @@ jobs:
|
||||
sudo rm ${TGT_DIR}/jellyfin-openapi-unstable_previous.json
|
||||
sudo ln -s unstable/${LAST_SPEC} ${TGT_DIR}/jellyfin-openapi-unstable_previous.json
|
||||
fi
|
||||
) 200>/run/openapi-unstable.lock
|
||||
|
||||
Reference in New Issue
Block a user