Skip to content

Commit e0cefd1

Browse files
committed
feat(action): support working-directory input to change cwd when executing the binary
1 parent 82c1bbb commit e0cefd1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

action-template/action.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ function main() {
8080

8181
const child = childProcess.spawnSync(cmd, args, {
8282
env: env,
83+
cwd: process.env["INPUT_WORKING-DIRECTORY"] || process.cwd(),
8384
// ignore stdin, capture stdout, stream stderr to the parent
8485
stdio: ['ignore', 'pipe', 'inherit'],
8586
})

action-template/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ inputs:
1919
branch:
2020
description: 'Target branch name'
2121
required: true
22+
working-directory:
23+
description: 'Switch to this directory before running commit-headless. Useful if you need to commit changes to a secondary repository.'
2224
branch-from:
2325
description: 'If necessary, create the remote branch using this commit hash as the branch point.'
2426
command:

0 commit comments

Comments
 (0)