Skip to content

Commit ec1a7f1

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

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
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:

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package main
22

3-
const VERSION = "0.5.1"
3+
const VERSION = "0.5.2"

0 commit comments

Comments
 (0)