From dee4f4231d0b7833a951c67e63707c71c53b7d07 Mon Sep 17 00:00:00 2001 From: Izan Gil <66965250+SrIzan10@users.noreply.github.com> Date: Sun, 5 May 2024 20:24:31 +0200 Subject: [PATCH] test github workflow --- .github/workflows/test.yml | 14 ++++++++++++++ src/index.ts | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..097a621 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,14 @@ +name: Test +on: + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Run Hello World + run: echo "Hello World" + - name: cat drizzle.config.ts + run: cat drizzle.config.ts diff --git a/src/index.ts b/src/index.ts index 9eb2310..fcb8d81 100644 --- a/src/index.ts +++ b/src/index.ts @@ -96,7 +96,7 @@ app.post('/ev/readyToMerge', async (c) => { owner: body.repository.owner.login, repo: body.repository.name, }) - break + break; } return c.json({ ok: true }) @@ -107,6 +107,20 @@ serve(app).on('listening', async () => { console.log(`Github login as ${(await octokit.rest.users.getAuthenticated()).data.login}`) }) +process.stdin.on('data', async (data) => { + if (data.toString().trim() === 'test thing') { + await octokit.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { + owner: 'sern-handler', + repo: 'automata', + workflow_id: 'test.yml', + ref: 'main', + headers: { + 'X-GitHub-Api-Version': '2022-11-28' + } + }) + } +}) + async function react(owner: string, repo: string, commentId: number, reaction: Reaction) { return await octokit.request('POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', { owner,