Skip to content

Commit 615e4bc

Browse files
committed
revert use toml to fetch opensearch core version
1 parent 1ba94e2 commit 615e4bc

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/convert-proto.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ jobs:
6464
with:
6565
github-token: ${{ secrets.GITHUB_TOKEN }}
6666
script: |
67-
const toml = require('toml');
68-
6967
// Check if version was provided as input
7068
const inputVersion = "${{ inputs.opensearch_version }}";
7169
if (inputVersion && inputVersion.trim() !== "") {
@@ -74,27 +72,28 @@ jobs:
7472
return;
7573
}
7674
77-
// Otherwise fetch version from gradle/libs.versions.toml on main branch
75+
// Otherwise fetch version from buildSrc/version.properties on main branch
7876
try {
7977
const response = await github.request(
8078
'GET /repos/{owner}/{repo}/contents/{path}',
8179
{
8280
owner: 'opensearch-project',
8381
repo: 'OpenSearch',
84-
path: 'gradle/libs.versions.toml',
82+
path: 'buildSrc/version.properties',
8583
ref: 'main'
8684
}
8785
);
8886
87+
// Decode the file content
8988
const content = Buffer.from(response.data.content, 'base64').toString('utf-8');
9089
91-
// Parse TOML and extract opensearch version
92-
const parsed = toml.parse(content);
93-
const version = parsed.versions.opensearch;
90+
// Extract opensearch version (e.g., "opensearch = 3.4.0")
91+
const match = content.match(/opensearch\s*=\s*([^\s]+)/);
9492
95-
if (version) {
93+
if (match && match[1]) {
94+
const version = match[1].trim();
9695
core.setOutput("version", version);
97-
console.log("Fetched OpenSearch version from gradle/libs.versions.toml: " + version);
96+
console.log("Fetched OpenSearch version from source: " + version);
9897
} else {
9998
core.setFailed("Could not find opensearch version in gradle/libs.versions.toml");
10099
}

0 commit comments

Comments
 (0)