Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevoss committed Jul 18, 2024
1 parent 34ac7cb commit eb3dec3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
4 changes: 0 additions & 4 deletions actions/log/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ inputs:
runs:
using: 'composite'
steps:
- name: Install ZX
shell: bash
run: sudo npm install -g zx

- name: Log message
shell: bash
run: npx zx ./actions/log/dist/index.js --message="${{inputs.message}}"
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from 'tsup';
import * as fs from 'node:fs/promises';

export default [defineActionConfig('log')];

Expand All @@ -7,5 +8,23 @@ function defineActionConfig(action: string) {
entry: [`actions/${action}/index.ts`],
outDir: `actions/${action}/dist`,
format: 'esm',

esbuildPlugins: [
{
name: 'remove-import-zx',
setup(build) {
build.onLoad({ filter: /.*/ }, async (args) => {
const content = await fs.readFile(args.path, 'utf-8');

return {
contents: content.replaceAll(
/^import .+ from 'zx';?$/gm,
'',
),
};
});
},
},
],
});
}

0 comments on commit eb3dec3

Please sign in to comment.