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
34 changes: 34 additions & 0 deletions .github/scripts/resolve-nginx-ref.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -euo pipefail

VERSION="${NGINX_VERSION:-}"

if [[ -z "${VERSION}" ]]; then
echo "NGINX_VERSION is not set" >&2
exit 1
fi

echo "Requested NGINX_VERSION=${VERSION}"

if [[ "${VERSION}" =~ ^[0-9]+\.[0-9]+\.x$ ]]; then
PREFIX="release-${VERSION%.x}."
REF=$(git ls-remote --tags https://github.com/nginx/nginx.git "refs/tags/${PREFIX}*" \
| sed -E 's#.*refs/tags/##; s#\^\{\}##' \
| grep -E "^${PREFIX}[0-9]+$" \
| sort -V \
| tail -n 1)
elif [[ "${VERSION}" =~ ^release-[0-9]+\.[0-9]+\.[0-9]+$ || "${VERSION}" == "master" || "${VERSION}" == "main" ]]; then
REF="${VERSION}"
else
echo "Unsupported NGINX_VERSION=${VERSION}" >&2
echo "Use e.g. 1.30.x, 1.29.x, 1.28.x or exact tag release-1.30.0" >&2
exit 1
fi

if [[ -z "${REF}" ]]; then
echo "No matching Nginx tag found for ${VERSION}" >&2
exit 1
fi

echo "Resolved Nginx ref: ${REF}"
echo "ref=${REF}" >> "${GITHUB_OUTPUT}"
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
repository: owasp-modsecurity/ModSecurity
path: ModSecurity
submodules: true
submodules: recursive
fetch-depth: 1
- name: Build libModSecurity
working-directory: ModSecurity
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: owasp-modsecurity/ModSecurity
submodules: true
submodules: recursive
path: nginx/objs/lib/ModSecurity
fetch-depth: 1
- name: Setup Conan
Expand Down
Loading
Loading