Skip to content

Commit

Permalink
fix: correct file addition logic in action.yml
Browse files Browse the repository at this point in the history
Refined file paths and file additions to the new tree creation
  • Loading branch information
gentlementlegen committed Oct 31, 2024
1 parent 82d9a02 commit 9690d25
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ runs:
});
console.log('Adding file:', manifestPath);
const distPath = '${{ github.workspace }}/dist/'
const relativePath = path.relative('.', distPath + 'index.js');
console.log('Adding file:', relativePath);
const newTree = await octokit.rest.git.createTree({
owner,
repo,
Expand All @@ -183,19 +186,12 @@ runs:
type: 'blob',
content: fs.readFileSync(manifestPath, 'utf8'),
},
...fs.readdirSync('${{ github.workspace }}/dist').map((file) => {
const relativePath = path.relative('.', '${{ github.workspace }}/dist/' + file);
console.log('Adding file:', '${{ github.workspace }}/dist/' + file);
return {
path: relativePath,
mode: '100644',
type: 'blob',
content: fs.readFileSync(
'${{ github.workspace }}/dist/' + file,
'utf-8',
),
};
}),
{
path: distPath,
mode: '100644',
type: 'blob',
content: fs.readFileSync(relativePath, 'utf8'),
},
],
});
Expand Down

0 comments on commit 9690d25

Please sign in to comment.