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 })) +}