File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -21,3 +21,27 @@ $ npx codemod <transform> --target <path> [...options]
2121See the [ codemod CLI doc] ( https://go.codemod.com/cli-docs ) for a full list of available commands.
2222
2323All codemods are also available in the [ Codemod Registry] ( https://go.codemod.com/registry ) .
24+
25+ ## GitHub Action
26+
27+ Use the composite action in this repository to run the Codemod CLI in GitHub Actions:
28+
29+ ``` yaml
30+ name : Codemod
31+ on :
32+ workflow_dispatch :
33+ jobs :
34+ run-codemod :
35+ runs-on : ubuntu-latest
36+ steps :
37+ - uses : actions/checkout@v4
38+ - name : Run codemod (dry run)
39+ uses : codemod-com/commons@v0
40+ with :
41+ args : " @codemod-com/your-codemod --dry-run"
42+ ` ` `
43+
44+ Notes:
45+ - ` inputs.args` is passed to `npx codemod` and defaults to `--version`.
46+ - The Action wraps `npx -y codemod`; no install needed.
47+ - To publish on Marketplace, create a tagged release (e.g., `v0.0.1`) and select "Publish this Action to Marketplace" when drafting the release.
Original file line number Diff line number Diff line change 1+ name : " Codemod CLI"
2+ description : " Run the Codemod CLI in GitHub Actions via npx."
3+ author : " Codemod"
4+ branding :
5+ icon : " code"
6+ color : " purple"
7+
8+ inputs :
9+ args :
10+ description : " Arguments to pass to the Codemod CLI (e.g. '@codemod-com/some-codemod --dry-run'). Defaults to '--version'."
11+ required : false
12+ default : " --version"
13+
14+ runs :
15+ using : " composite"
16+ steps :
17+ - name : Run Codemod
18+ shell : bash
19+ run : |
20+ set -euo pipefail
21+ npx -y codemod ${{ inputs.args }}
22+
23+
You can’t perform that action at this time.
0 commit comments