Skip to content
Open
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
10 changes: 8 additions & 2 deletions github-action/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ echo -e "${BLUE}Parameters:${NC}" "$PARAMETERS"
echo "::endgroup::"

handle_file_error () {
echo -e "${RED}Validation error: File not found:${NC}" "$1"
echo -e "skipping...\n"
local filepath="$1"
echo -e "${RED}Validation error: File not found:${NC}" "$filepath" >&2
echo -e "skipping...\n" >&2
return 0
}

handle_validate () {
Expand All @@ -102,6 +104,7 @@ handle_validate () {
echo -e "${BLUE}Executing command:${NC}" "asyncapi validate $FILEPATH $PARAMETERS"
eval "asyncapi validate $FILEPATH $PARAMETERS"
echo "::endgroup::"
return 0
}

handle_optimize () {
Expand All @@ -116,6 +119,7 @@ handle_optimize () {
echo -e "${BLUE}Executing command:${NC}" "asyncapi optimize $FILEPATH $PARAMETERS"
eval "asyncapi optimize $FILEPATH $PARAMETERS"
echo "::endgroup::"
return 0
}

handle_generate () {
Expand Down Expand Up @@ -146,6 +150,7 @@ handle_generate () {
exit 1
fi
echo "::endgroup::"
return 0
}

handle_convert () {
Expand All @@ -172,6 +177,7 @@ handle_convert () {
echo -e "${BLUE}Executing command:${NC}" "asyncapi convert $FILEPATH -o $OUTPUT $PARAMETERS"
eval "asyncapi convert $FILEPATH -o $OUTPUT $PARAMETERS"
fi
return 0
}

if [[ $COMMAND == "validate" ]]; then
Expand Down
9 changes: 6 additions & 3 deletions github-action/lib/bump-action-version.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');

function bumpActionVersion() {
const packageJsonPath = path.join(__dirname, '../../', 'package.json');
Expand All @@ -9,7 +9,10 @@ function bumpActionVersion() {
const outputPath = path.join(__dirname, '../../', 'action.yml');

const templateContent = fs.readFileSync(templatePath, 'utf8');
const updatedContent = templateContent.replace(/\${ version }/g, packageJsonVersion);
const updatedContent = templateContent.replaceAll(
'${ version }',
packageJsonVersion
);

fs.writeFileSync(outputPath, updatedContent, 'utf8');
console.log(`Updated action.yml with version ${packageJsonVersion}`);
Expand Down
Loading