From 8b3e697d4af3eafcdc3de49bca671ae063d33892 Mon Sep 17 00:00:00 2001 From: Miguel Ramos Date: Fri, 19 Jul 2024 23:40:39 +0100 Subject: [PATCH] chore: init project --- .github/workflows/log_merge.yml | 20 ++++++++++++++++++++ .github/workflows/log_push.yml | 18 ++++++++++++++++++ package.json | 11 +++++++++++ test.mjs | 5 +++++ 4 files changed, 54 insertions(+) create mode 100644 .github/workflows/log_merge.yml create mode 100644 .github/workflows/log_push.yml create mode 100644 package.json create mode 100644 test.mjs diff --git a/.github/workflows/log_merge.yml b/.github/workflows/log_merge.yml new file mode 100644 index 0000000..50aabc1 --- /dev/null +++ b/.github/workflows/log_merge.yml @@ -0,0 +1,20 @@ +on: + pull_request: + types: [closed] + +jobs: + echo-input: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + - run: npm ci + # or one-off: + # - run: npm install execa + - uses: actions/github-script@v7 + with: + script: | + const { logging } = await import('${{ github.workspace }}/test.mjs'); + logging({ github, context, core }); diff --git a/.github/workflows/log_push.yml b/.github/workflows/log_push.yml new file mode 100644 index 0000000..d11b654 --- /dev/null +++ b/.github/workflows/log_push.yml @@ -0,0 +1,18 @@ +on: push + +jobs: + echo-input: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + - run: npm ci + # or one-off: + # - run: npm install execa + - uses: actions/github-script@v7 + with: + script: | + const { logging } = await import('${{ github.workspace }}/test.mjs'); + logging({ github, context, core }); diff --git a/package.json b/package.json new file mode 100644 index 0000000..376719e --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "log-actions", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "description": "" +} diff --git a/test.mjs b/test.mjs new file mode 100644 index 0000000..111c664 --- /dev/null +++ b/test.mjs @@ -0,0 +1,5 @@ +export function logging({ github, context, core }) { + const util = require('util'); + + console.log(util.inspect({ github, context, core }, { showHidden: false, depth: null, colors: true })) +}