Skip to content

Commit 9eb44fd

Browse files
authored
Merge pull request #376 from Easton97-Jens/master_test_update
add new test and update
2 parents e6a568a + 6b789e1 commit 9eb44fd

4 files changed

Lines changed: 454 additions & 8 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
VERSION="${NGINX_VERSION:-}"
5+
6+
if [[ -z "${VERSION}" ]]; then
7+
echo "NGINX_VERSION is not set" >&2
8+
exit 1
9+
fi
10+
11+
echo "Requested NGINX_VERSION=${VERSION}"
12+
13+
if [[ "${VERSION}" =~ ^[0-9]+\.[0-9]+\.x$ ]]; then
14+
PREFIX="release-${VERSION%.x}."
15+
REF=$(git ls-remote --tags https://github.com/nginx/nginx.git "refs/tags/${PREFIX}*" \
16+
| sed -E 's#.*refs/tags/##; s#\^\{\}##' \
17+
| grep -E "^${PREFIX}[0-9]+$" \
18+
| sort -V \
19+
| tail -n 1)
20+
elif [[ "${VERSION}" =~ ^release-[0-9]+\.[0-9]+\.[0-9]+$ || "${VERSION}" == "master" || "${VERSION}" == "main" ]]; then
21+
REF="${VERSION}"
22+
else
23+
echo "Unsupported NGINX_VERSION=${VERSION}" >&2
24+
echo "Use e.g. 1.30.x, 1.29.x, 1.28.x or exact tag release-1.30.0" >&2
25+
exit 1
26+
fi
27+
28+
if [[ -z "${REF}" ]]; then
29+
echo "No matching Nginx tag found for ${VERSION}" >&2
30+
exit 1
31+
fi
32+
33+
echo "Resolved Nginx ref: ${REF}"
34+
echo "ref=${REF}" >> "${GITHUB_OUTPUT}"

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
repository: owasp-modsecurity/ModSecurity
3333
path: ModSecurity
34-
submodules: true
34+
submodules: recursive
3535
fetch-depth: 1
3636
- name: Build libModSecurity
3737
working-directory: ModSecurity
@@ -274,7 +274,7 @@ jobs:
274274
uses: actions/checkout@v4
275275
with:
276276
repository: owasp-modsecurity/ModSecurity
277-
submodules: true
277+
submodules: recursive
278278
path: nginx/objs/lib/ModSecurity
279279
fetch-depth: 1
280280
- name: Setup Conan

0 commit comments

Comments
 (0)