diff --git a/.github/workflows/setup-stackql-test.yml b/.github/workflows/setup-stackql-test.yml index b9e2935..172dc1f 100644 --- a/.github/workflows/setup-stackql-test.yml +++ b/.github/workflows/setup-stackql-test.yml @@ -29,29 +29,31 @@ jobs: with: use_wrapper: ${{matrix.use_wrapper}} - - name: Get Stackql Version - id: get-stackql-version + - name: Run Registry List + id: run-registry-list run: | - echo "stackql_version<> $GITHUB_ENV - stackql --version >> $GITHUB_ENV + echo "registry_list_output<> $GITHUB_ENV + stackql exec "REGISTRY LIST" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - - name: Validate Stackql Version + - name: Validate Registry List run: | - # Extract only the relevant line containing version information - VERSION_OUTPUT=$(echo "${{ env.stackql_version }}" | grep -E 'stackql v[0-9]+\.[0-9]+\.[0-9]+') - echo "Version output: $VERSION_OUTPUT" - - SEMVER_REGEX="v[0-9]+\.[0-9]+\.[0-9]+" - PLATFORM_REGEX="(Linux|Darwin|Windows|Homebrew)" - - if ! [[ "$VERSION_OUTPUT" =~ $SEMVER_REGEX ]]; then - echo "Semantic version does not match expected format" + echo "Registry list output:" + echo "$registry_list_output" + + # Validate header row: expect | provider | and | version | columns + # Use [[:space:]] instead of \s for macOS bash 3.2 compatibility + HEADER_REGEX='\|[[:space:]]*provider[[:space:]]*\|[[:space:]]*version[[:space:]]*\|' + if ! [[ "$registry_list_output" =~ $HEADER_REGEX ]]; then + echo "Registry list header does not match expected format" exit 1 fi - if ! [[ "$VERSION_OUTPUT" =~ $PLATFORM_REGEX ]]; then - echo "Platform information does not match expected formats" + + # Validate at least one data row: | | v.. | + DATA_ROW_REGEX='\|[[:space:]]*[a-z][a-z0-9_]*[[:space:]]*\|[[:space:]]*v[0-9]+\.[0-9]+\.[0-9]+[[:space:]]*\|' + if ! [[ "$registry_list_output" =~ $DATA_ROW_REGEX ]]; then + echo "Registry list does not contain a valid data row" exit 1 fi - echo "version output validated successfully." \ No newline at end of file + echo "Registry list validated successfully." \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 5380714..69af66a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -34544,6 +34544,13 @@ async function setup () { await makeExecutable(cliPath, osPlatform); } + // Print stackql version to action logs + const exeSuffix = osPlatform === 'win32' ? '.exe' : ''; + const stackqlBin = external_path_namespaceObject.join(cliPath, `stackql${exeSuffix}`); + info('stackql version:'); + const versionOutput = (0,external_child_process_namespaceObject.execSync)(`"${stackqlBin}" --version`, { encoding: 'utf-8' }); + info(versionOutput.trim()); + // Check if wrapper is needed and if it's not Darwin const useWrapper = getInput('use_wrapper') === 'true'; if (useWrapper && osPlatform !== 'darwin') { diff --git a/index.js b/index.js index 7df7da9..124f4df 100644 --- a/index.js +++ b/index.js @@ -118,6 +118,13 @@ async function setup () { await makeExecutable(cliPath, osPlatform); } + // Print stackql version to action logs + const exeSuffix = osPlatform === 'win32' ? '.exe' : ''; + const stackqlBin = path.join(cliPath, `stackql${exeSuffix}`); + core.info('stackql version:'); + const versionOutput = execSync(`"${stackqlBin}" --version`, { encoding: 'utf-8' }); + core.info(versionOutput.trim()); + // Check if wrapper is needed and if it's not Darwin const useWrapper = core.getInput('use_wrapper') === 'true'; if (useWrapper && osPlatform !== 'darwin') {