Skip to content

Security: LusterAnalyst/javascript-action-with-es-modules

Security

security.md

⚑ JavaScript Action with ES Modules

⚑ JavaScript Action with ES Modules is the complete English-language guide to building modern custom GitHub Actions in JavaScript using native ES Modules. Learn how to structure action.yml, use node20 runtime, import local and npm modules, bundle with esbuild, handle inputs and outputs, and test your action in real workflows. Built for DevOps engineers, maintainers, and developers who want to ship CI tooling the right way. Completely free. No signup. No paywall. No hidden chapters.

images (28)

🎯 Why This Guide Is Unique

Most GitHub Actions tutorials still use CommonJS with require() and old node16. This guide is fully modern β€” pure ES Modules, node20 runtime, import / export, and esbuild-based bundling. Every snippet is tested on real GitHub workflows.

deepseek_svg_20261019_b3dfa6 deepseek_svg_20261019_2f3d0b deepseek_svg_20261019_b029b2

πŸš€ Quick Start Guide

Step Action Time
1 Scaffold the action repo ~3 min
2 Add action.yml ~5 min
3 Write main.mjs ~10 min
4 Bundle with esbuild ~5 min
5 Test in a workflow ~10 min
6 Publish the action ~5 min

πŸ’‘ Tip: Always commit the bundled dist/index.mjs β€” GitHub Actions runs the bundle, not your source.


🎁 What You Get

Feature Description Status
🧩 action.yml Modern metadata βœ… Active
⚑ node20 Runtime Latest supported βœ… Active
πŸ“¦ ES Modules import / export βœ… Active
πŸ”¨ esbuild Bundle Single file output βœ… Active
πŸŽ›οΈ Inputs + Outputs @actions/core βœ… Active
πŸ§ͺ Test Workflow Real CI run βœ… Active
deepseek_svg_20261019_b3dfa6 deepseek_svg_20261019_2f3d0b deepseek_svg_20261019_b029b2

❓ What Is a JavaScript Action

Term Description
Action Reusable CI step
action.yml Metadata file
node20 Supported runtime
ESM ES Modules
esbuild Fast bundler
@actions/core Inputs/outputs API

Why use it?

  • βœ… Reusable across repos
  • βœ… Modern ES Modules
  • βœ… No Docker needed
  • βœ… Runs on any runner
  • βœ… Free guide

πŸ” Action Types

Type Description Best For
JS Action Node.js code Most cases
Composite YAML steps Simple glue
Docker Container Heavy deps
Reusable WF Full workflow Orchestration
ES Modules import/export Modern JS
CommonJS Legacy Older setups

πŸ“Š Before vs After

Feature Before After
Runtime node16 βœ… node20
Modules CommonJS βœ… ESM
Bundle ncc βœ… esbuild
Source One file βœ… Modules
Testing Manual βœ… Real CI
Price Paid courses βœ… Free guide

🌍 Supported Platforms

Platform Status Notes
GitHub Actions βœ… Supported All runners
Ubuntu Runner βœ… Supported Best support
Windows Runner βœ… Supported Native
macOS Runner βœ… Supported Native
Self-Hosted βœ… Supported Any
Local act βœ… Supported Local test

πŸ“¦ Package Contents

Component Description Format
Setup Guide Project + files MD
action.yml Guide Metadata fields MD
ESM Guide import/export MD
Bundle Guide esbuild config MD
Inputs Guide @actions/core MD
Test Guide Real workflow MD

πŸ“‹ System Requirements

Component Minimum Recommended
OS Any modern OS Latest
CPU Dual-core 1.8 GHz Quad-core 3.0 GHz+
RAM 2 GB 8 GB
Storage 200 MB 1 GB
Node 18+ 20+
Git 2.30+ Latest

πŸ”§ Setup Walkthrough

Step 1 β€” Scaffold

Create the repo and src/ folder.

Step 2 β€” action.yml

Set runs.using: node20 and main: dist/index.mjs.

Step 3 β€” main.mjs

Write the entry with import.

Step 4 β€” Bundle

Run esbuild to output dist/index.mjs.

Step 5 β€” Test

Add a test workflow to .github/workflows/.

Step 6 β€” Publish

Tag a release and use uses: you/action@v1.


🌐 How To Use

First Action

  1. Scaffold the repo
  2. Configure action.yml
  3. Write main.mjs
  4. Bundle with esbuild
  5. Test in a workflow
  6. Publish

User Tips

  • βœ… Commit dist/
  • βœ… Use node20
  • βœ… Validate inputs
  • βœ… Log with core.info
  • βœ… Tag releases

πŸ’‘ Best Tips

  • βœ… Prefer esbuild over ncc
  • βœ… Keep source modular
  • βœ… Add tests
  • βœ… Document inputs
  • βœ… Version tags

πŸ”§ Troubleshooting

Problem Solution
"Cannot find module" Commit dist/
Wrong runtime Set node20
Inputs empty Check with:
Bundling fails Add esbuild config
Action not found Tag release
Permission error Check permissions:

❓ FAQ

Is this guide free? Yes β€” completely free to read.
Does it use ES Modules? Yes β€” pure `import`/`export`.
Is node20 supported? Yes β€” this is the modern runtime.
Do I need Docker? No β€” JS actions don't require it.
How do I bundle? esbuild is covered in full.
Can I test locally? Yes β€” with `act`.
Does it cover publishing? Yes β€” tag + release guide.
Is it beginner-friendly? Yes β€” starts from scaffold.

⚠️ Terms of Use

βœ… Allowed ❌ Forbidden
Personal use Selling the guide
Commercial CI Redistributing as paid
Team onboarding Removing author credits
Educational use Bundling with malware

🏁 Conclusion

JavaScript Action with ES Modules is the complete guide to modern GitHub Actions:

  • βœ… node20 runtime
  • βœ… ES Modules
  • βœ… esbuild bundling
  • βœ… Inputs + outputs
  • βœ… Real workflow tests
  • βœ… Completely free

Ship modern actions β€” open the guide today.


πŸ” SEO Keywords and Tags

Primary Keywords

  • JavaScript Action GitHub
  • ES Modules GitHub Actions
  • node20 GitHub Action
  • Custom Action Guide
  • GitHub Action esbuild

Secondary Keywords

  • GitHub Actions 2026
  • action.yml node20
  • ESM GitHub Action
  • Bundle Action esbuild
  • Actions Inputs Outputs

Long-Tail Keywords

  • How to build a JavaScript GitHub Action
  • Use ES Modules in GitHub Actions
  • Bundle a Node20 action with esbuild
  • Publish a custom GitHub Action
  • Test a JavaScript action in CI
  • action.yml node20 main.mjs example

Tags

GitHubActions, JavaScript, ESM, node20, CI, Free Guide, 2026

SEO Description

JavaScript Action with ES Modules β€” free guide to node20, ESM, esbuild bundling, and publishing. Build modern custom GitHub Actions. Open now!

There aren't any published security advisories