Skip to content

Commit

Permalink
Enhance JSON handling and debugging in GitHub Actions
Browse files Browse the repository at this point in the history
- Updated get_module_path.js to ensure proper JSON formatting and added logging for the final output.
- Modified lint.yml to parse and log the module names output correctly, improving visibility into the workflow's execution.

These changes improve error handling and debugging capabilities in the CI workflow.
  • Loading branch information
edmundmiller committed Dec 12, 2024
1 parent 06e885a commit 8f619f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/scripts/get_module_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ function run({ github, context }) {
const result = get_module_names(files);
console.log('Processed result:', result);

// Return stringified result for GitHub Actions output
return JSON.stringify(result);
// Ensure we're returning a properly formatted JSON string
const jsonResult = JSON.stringify(result);
console.log('Final JSON output:', jsonResult);
return jsonResult;
} catch (error) {
console.error("Error processing module paths:", error);
console.error("Error details:", {
errorName: error.name,
errorMessage: error.message,
errorStack: error.stack
});
// Return empty array instead of throwing
return "[]";
}
}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ jobs:
- name: debug
run: |
echo "Modules files: ${{ steps.filter.outputs.modules_files }}"
echo "Module names: ${{ steps.module_names.outputs.result }}"
echo "Module names: ${{ fromJson(steps.module_names.outputs.result) }}"
echo "Raw module names output: ${{ steps.module_names.outputs.result }}"
nf-core-lint-modules:
runs-on: ${{ github.event.inputs.runners || 'self-hosted' }}
Expand Down

0 comments on commit 8f619f6

Please sign in to comment.