diff --git a/action.js b/action.js index 765d16355cd2b25ddaed070ace1b5e50009d4047..47c0c5efc93857b6b2c6f6c5496a7455ea27910c 100755 --- a/action.js +++ b/action.js @@ -202,6 +202,21 @@ try { ref: sha, }) console.log('commit: ' + require('util').inspect(commit, { depth: null })) + let filename + for (const file of commit.data.files) { + filename = file.filename + if (filename.startsWith('articles/')) { + break + } + } + console.log('filename: ' + require('util').inspect(filename, { depth: null })); + const content = await octokit.rest.repos.getContent({ + owner: 'duty-machine', + repo: 'news', + ref: sha, + path: filename, + }) + console.log('content: ' + require('util').inspect(content, { depth: null })); } catch (error) { core.setFailed(error.message); }