From 41608482526f64b66184925af5141b0038195ae1 Mon Sep 17 00:00:00 2001 From: jakub Date: Sun, 24 Nov 2024 15:44:10 +0100 Subject: [PATCH] test basic octokit call --- actions/request-review/action.yaml | 3 +++ actions/request-review/index.js | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 actions/request-review/index.js diff --git a/actions/request-review/action.yaml b/actions/request-review/action.yaml index 1e6b4d5..43479dd 100644 --- a/actions/request-review/action.yaml +++ b/actions/request-review/action.yaml @@ -1,4 +1,7 @@ name: SCI Review Manager Helper +inputs: + github-token: + default: ${{ github.token }} runs: using: node20 main: index.js \ No newline at end of file diff --git a/actions/request-review/index.js b/actions/request-review/index.js new file mode 100644 index 0000000..3dfcb67 --- /dev/null +++ b/actions/request-review/index.js @@ -0,0 +1,16 @@ +const core = require('@actions/core'); +const github = require('@actions/github'); + +async function run() { + const token = core.getInput('github-token', {required: true}); + const octokit = github.getOctokit(token); + + const { data: pullRequest } = await octokit.rest.pulls.list({ + owner: github.context.owner, + repo: github.context.repo + }); + + console.log(pullRequest); +} + +run(); \ No newline at end of file