Skip to content

Commit

Permalink
Debug: add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamenamcinteer committed Oct 18, 2024
1 parent cae3e51 commit dca77da
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/scripts/create-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ const octokit = new Octokit({ auth: token });
// Extract repository owner and name
const [OWNER, REPO] = process.env.GITHUB_REPOSITORY.split('/');

// Read and parse the JSON output from yarn outdated
// Read the output from yarn outdated
const data = fs.readFileSync('outdated.json', 'utf8');
const parsed = JSON.parse(data);

// Debug: Print the raw data to identify the issue
console.log('Raw data from outdated.json:', data);

try {
const parsed = JSON.parse(data);
console.log('Parsed JSON:', parsed);
} catch (error) {
console.error('Error parsing JSON:', error.message);
process.exit(1);
}

// Check if the data type is "table" and extract dependencies
if (parsed.type !== 'table' || !parsed.data || !parsed.data.body) {
Expand Down

0 comments on commit dca77da

Please sign in to comment.