Skip to content

Commit c67945b

Browse files
ci: handle with/without v prefix for versions
Signed-off-by: Patrick Stephens <pat@fluent.do>
1 parent 57b91b3 commit c67945b

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/add-mapping-version.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ jobs:
1919
add-mapping-version:
2020
uses: ./.github/workflows/call-add-mapping-version.yaml
2121
with:
22-
agent-version: ${{ github.event.inputs.agent-version }}
23-
oss-version: ${{ github.event.inputs.oss-version }}
24-
dry-run: ${{ github.event.inputs.dry-run }}
22+
agent-version: ${{ inputs.agent-version }}
23+
oss-version: ${{ inputs.oss-version }}
24+
dry-run: ${{ inputs.dry-run }}

docs/version-mapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ The following shows the underlying [OSS version of Fluent Bit](https://github.co
66

77
|FluentDo Agent Version|OSS Version Base|
88
|----------------------|----------------|
9-
| 25.7.1 | 4.0.3 |
9+
| 25.7.1 | 4.0.3 |

scripts/add-mapping-version.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,24 @@ MAPPING_FILE=${MAPPING_FILE:-$DOCS_DIR/version-mapping.md}
1818
NEW_OSS_VERSION=${NEW_OSS_VERSION:?}
1919
NEW_AGENT_VERSION=${NEW_AGENT_VERSION:?}
2020

21+
# Handle version string with or without a v prefix - we just want semver
22+
if [[ "$NEW_OSS_VERSION" =~ ^v?([0-9]+\.[0-9]+\.[0-9]+)$ ]] ; then
23+
NEW_OSS_VERSION=${BASH_REMATCH[1]}
24+
echo "Valid OSS version string: $NEW_VERSION"
25+
else
26+
echo "ERROR: Invalid OSS semver string: $NEW_OSS_VERSION"
27+
exit 1
28+
fi
29+
30+
# Handle version string with or without a v prefix - we just want semver
31+
if [[ "$NEW_AGENT_VERSION" =~ ^v?([0-9]+\.[0-9]+\.[0-9]+)$ ]] ; then
32+
NEW_AGENT_VERSION=${BASH_REMATCH[1]}
33+
echo "Valid FluentDo agent version string: $NEW_AGENT_VERSION"
34+
else
35+
echo "ERROR: Invalid FluentDo agent semver string: $NEW_AGENT_VERSION"
36+
exit 1
37+
fi
38+
2139
# Check if the mapping file exists
2240
if [[ ! -f "$MAPPING_FILE" ]]; then
2341
echo "ERROR: Mapping file $MAPPING_FILE does not exist."

0 commit comments

Comments
 (0)