Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: log action file path [EDS-269] #3

Merged
merged 30 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/log-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Log Test

on: [workflow_dispatch]
on: [pull_request, workflow_dispatch]

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules/
.vscode/
.idea/
log/
.DS_Store/
tmp/

Expand Down
2 changes: 1 addition & 1 deletion actions/log/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ runs:
steps:
- name: Log message
shell: bash
run: npx zx@8 ./dist/index.js --message="${{inputs.message}}"
run: npx zx ./actions/log/dist/index.js --message="${{ inputs.message }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: npx zx ./actions/log/dist/index.js --message="${{ inputs.message }}"
run: npx zx@8 ./actions/log/dist/index.js --message="${{ inputs.message }}"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

1 change: 0 additions & 1 deletion actions/log/dist/index.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env zx

// actions/log/index.ts
import { echo, minimist } from "zx";
var args = minimist(process.argv.slice(2), {
string: ["message"],
default: {
Expand Down
24 changes: 12 additions & 12 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,
'',
),
};
});
},
},
],
Copy link
Member

@StyleShit StyleShit Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
'',
),
};
});
},
},
],
esbuildPlugins: [removeZXImports()],

Maybe? + add explanation why we did this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

});
}