Skip to content

Commit

Permalink
chore: init project
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelramos committed Jul 19, 2024
0 parents commit 8b3e697
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/log_merge.yml
Original file line number Diff line number Diff line change
@@ -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 });
18 changes: 18 additions & 0 deletions .github/workflows/log_push.yml
Original file line number Diff line number Diff line change
@@ -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 });
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": ""
}
5 changes: 5 additions & 0 deletions test.mjs
Original file line number Diff line number Diff line change
@@ -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 }))
}

0 comments on commit 8b3e697

Please sign in to comment.