From 79fc2631d607926374aad1330a84313fc8ff8dfd Mon Sep 17 00:00:00 2001
From: Ciro Santilli <cirosantilli@proton.me>
Date: Wed, 3 Aug 2022 03:01:11 +0000
Subject: [PATCH] content

---
 action.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/action.js b/action.js
index 765d163..47c0c5e 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);
 }
-- 
GitLab