Skip to content

Commit

Permalink
Added debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
m-radmacher committed Oct 24, 2022
1 parent 5e105f4 commit f5393b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function run() {
console.log('Wrote PDF file.');
if (uploadArtifact) {
console.log('Uploading artifact...');
core.debug('Temporary folder content: ' + fs.readdirSync(process.env.RUNNER_TEMP).join('; '));
yield artifact
.create()
.uploadArtifact('changelog', [path_1.default.join(process.env.RUNNER_TEMP, 'output.pdf')], '.');
Expand All @@ -159,6 +160,8 @@ function run() {
}
function createPDF(commits, owner, repo, language, baseTag, headTag) {
var _a, _b, _c;
// create empty pdf file
fs.closeSync(fs.openSync(path_1.default.join(process.env.RUNNER_TEMP, 'output.pdf'), 'w'));
const doc = new pdfkit_1.default();
doc.pipe(fs.createWriteStream(path_1.default.join(process.env.RUNNER_TEMP, 'output.pdf')));
// list available fonts
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ async function run() {
console.log('Wrote PDF file.');
if (uploadArtifact) {
console.log('Uploading artifact...');
core.debug('Temporary folder content: ' + fs.readdirSync(process.env.RUNNER_TEMP as string).join('; '));
await artifact
.create()
.uploadArtifact('changelog', [path.join(process.env.RUNNER_TEMP as string, 'output.pdf')], '.');
Expand All @@ -82,6 +83,8 @@ async function run() {
}

function createPDF(commits: Commit[], owner: string, repo: string, language: string, baseTag: string, headTag: string) {
// create empty pdf file
fs.closeSync(fs.openSync(path.join(process.env.RUNNER_TEMP as string, 'output.pdf'), 'w'));
const doc = new PDFDocument();
doc.pipe(fs.createWriteStream(path.join(process.env.RUNNER_TEMP as string, 'output.pdf')));

Expand Down

0 comments on commit f5393b8

Please sign in to comment.